From 23c08658311984045f1af573727e3f06adc6db06 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 13 Dec 2016 12:19:50 +1300 Subject: [PATCH] SWIG_Tcl_ObjectDelete: Fix potential NULL pointer dereferences --- Lib/tcl/tclrun.swg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/tcl/tclrun.swg b/Lib/tcl/tclrun.swg index e6531e555..f671ba240 100644 --- a/Lib/tcl/tclrun.swg +++ b/Lib/tcl/tclrun.swg @@ -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); }