diff Modules/_tkinter.c @ 36872:b16e504413c3 2.4

Backport trunk's r42888 (thomas.wouters): Coverity found refleak: need to free 'v' after calling Tkinter_Error().
author Thomas Wouters <thomas@python.org>
date Tue, 07 Mar 2006 14:06:31 +0000
parents 0d44d9071e97
children efeebc8770e5
line wrap: on
line diff
--- a/Modules/_tkinter.c	Tue Mar 07 13:39:26 2006 +0000
+++ b/Modules/_tkinter.c	Tue Mar 07 14:06:31 2006 +0000
@@ -676,8 +676,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();