[Python-checkins] r42888 - python/trunk/Modules/_tkinter.c

thomas.wouters python-checkins at python.org
Tue Mar 7 15:04:31 CET 2006


Author: thomas.wouters
Date: Tue Mar  7 15:04:31 2006
New Revision: 42888

Modified:
   python/trunk/Modules/_tkinter.c
Log:

Coverity found refleak: need to free 'v' after calling Tkinter_Error().
Will backport to release24.



Modified: python/trunk/Modules/_tkinter.c
==============================================================================
--- python/trunk/Modules/_tkinter.c	(original)
+++ python/trunk/Modules/_tkinter.c	Tue Mar  7 15:04:31 2006
@@ -686,8 +686,11 @@
 		ckfree(args);
 	}
 
-	if (Tcl_AppInit(v->interp) != TCL_OK)
-		return (TkappObject *)Tkinter_Error((PyObject *)v);
+	if (Tcl_AppInit(v->interp) != TCL_OK) {
+		PyObject *result = Tkinter_Error((PyObject *)v);
+		Py_DECREF((PyObject *)v);
+		return (TkappObject *)result;
+	}
 
 	EnableEventHook();
 


More information about the Python-checkins mailing list