summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-03-07 14:04:31 (GMT)
committerThomas Wouters <thomas@python.org>2006-03-07 14:04:31 (GMT)
commita74a84d4cbda0fcfe8c62422ccf98efae6298054 (patch)
tree5d91a85682aeabe3f4c1e4f51ad8ff4fb07b0af6 /Modules
parent58780d2642a3a82004c7f2c205b78450b12f177a (diff)
downloadcpython-a74a84d4cbda0fcfe8c62422ccf98efae6298054.zip
cpython-a74a84d4cbda0fcfe8c62422ccf98efae6298054.tar.gz
cpython-a74a84d4cbda0fcfe8c62422ccf98efae6298054.tar.bz2
Coverity found refleak: need to free 'v' after calling Tkinter_Error().
Will backport to release24.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 03f1453..b85e158 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -686,8 +686,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();