Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a74a84d

Browse files
committed
Coverity found refleak: need to free 'v' after calling Tkinter_Error().
Will backport to release24.
1 parent 58780d2 commit a74a84d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Modules/_tkinter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,11 @@ Tkapp_New(char *screenName, char *baseName, char *className,
686686
ckfree(args);
687687
}
688688

689-
if (Tcl_AppInit(v->interp) != TCL_OK)
690-
return (TkappObject *)Tkinter_Error((PyObject *)v);
689+
if (Tcl_AppInit(v->interp) != TCL_OK) {
690+
PyObject *result = Tkinter_Error((PyObject *)v);
691+
Py_DECREF((PyObject *)v);
692+
return (TkappObject *)result;
693+
}
691694

692695
EnableEventHook();
693696

0 commit comments

Comments
 (0)