Skip to content

Commit 289cf0f

Browse files
brandtbuchermiss-islington
authored andcommitted
bpo-38823: Clean up refleaks in _tkinter initialization. (pythonGH-17206)
https://bugs.python.org/issue38823
1 parent 5383956 commit 289cf0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_tkinter.c

+2
Original file line numberDiff line numberDiff line change
@@ -3555,11 +3555,13 @@ PyInit__tkinter(void)
35553555
if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
35563556
str_path = _get_tcl_lib_path();
35573557
if (str_path == NULL && PyErr_Occurred()) {
3558+
Py_DECREF(m);
35583559
return NULL;
35593560
}
35603561
if (str_path != NULL) {
35613562
wcs_path = PyUnicode_AsWideCharString(str_path, NULL);
35623563
if (wcs_path == NULL) {
3564+
Py_DECREF(m);
35633565
return NULL;
35643566
}
35653567
SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path);

0 commit comments

Comments
 (0)