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

Skip to content

Commit 3879333

Browse files
committed
PyImport_ReloadModule(): Nailed a small memory leak. In the
else-clause of the subname test, the parentname object was never DECREF'd.
1 parent 54ecc3d commit 3879333

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/import.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,7 @@ PyImport_ReloadModule(m)
18001800
if (parentname == NULL)
18011801
return NULL;
18021802
parent = PyDict_GetItem(modules, parentname);
1803+
Py_DECREF(parentname);
18031804
if (parent == NULL) {
18041805
PyErr_Format(PyExc_ImportError,
18051806
"reload(): parent %.200s not in sys.modules",

0 commit comments

Comments
 (0)