]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport trunk's r42888 (thomas.wouters):
authorThomas Wouters <thomas@python.org>
Tue, 7 Mar 2006 14:06:31 +0000 (14:06 +0000)
committerThomas Wouters <thomas@python.org>
Tue, 7 Mar 2006 14:06:31 +0000 (14:06 +0000)
Coverity found refleak: need to free 'v' after calling Tkinter_Error().

Modules/_tkinter.c

index 632f3d6c9a0db16be135a94155abb1efcb38700a..bc64ad1d113c2ff117602475404eaa2a5829d72c 100644 (file)
@@ -676,8 +676,11 @@ Tkapp_New(char *screenName, char *baseName, char *className,
                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();