SWIG_Tcl_ObjectDelete: Fix potential NULL pointer dereferences

This commit is contained in:
Olly Betts 2016-12-13 12:19:50 +13:00
commit 23c0865831

View file

@ -293,7 +293,8 @@ SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) {
SWIGRUNTIME void
SWIG_Tcl_ObjectDelete(ClientData clientData) {
swig_instance *si = (swig_instance *) clientData;
if ((si) && (si->destroy) && (SWIG_Disown(si->thisvalue))) {
if (!si) return;
if (si->destroy && SWIG_Disown(si->thisvalue)) {
if (si->classptr->destructor) {
(si->classptr->destructor)(si->thisvalue);
}