diff options
author | Brandt Bucher <brandtbucher@gmail.com> | 2019-11-18 14:52:36 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-11-18 14:52:36 (GMT) |
commit | 289cf0fbf78c4f38c38ac71ac8b772be7ec2672f (patch) | |
tree | ba1003a03a816956e9557c5f95026c4938966940 /Modules | |
parent | 5383956583bb758f3828513bcdd011871f24a0e8 (diff) | |
download | cpython-289cf0fbf78c4f38c38ac71ac8b772be7ec2672f.zip cpython-289cf0fbf78c4f38c38ac71ac8b772be7ec2672f.tar.gz cpython-289cf0fbf78c4f38c38ac71ac8b772be7ec2672f.tar.bz2 |
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
https://bugs.python.org/issue38823
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 235cb6b..40d2ed7 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -3555,11 +3555,13 @@ PyInit__tkinter(void) if (!ret && GetLastError() == ERROR_ENVVAR_NOT_FOUND) { str_path = _get_tcl_lib_path(); if (str_path == NULL && PyErr_Occurred()) { + Py_DECREF(m); return NULL; } if (str_path != NULL) { wcs_path = PyUnicode_AsWideCharString(str_path, NULL); if (wcs_path == NULL) { + Py_DECREF(m); return NULL; } SetEnvironmentVariableW(L"TCL_LIBRARY", wcs_path); |