mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
PyImport_ReloadModule(): Nailed a small memory leak. In the
else-clause of the subname test, the parentname object was never DECREF'd.
This commit is contained in:
parent
54ecc3d24f
commit
3879333b9e
1 changed files with 1 additions and 0 deletions
|
@ -1800,6 +1800,7 @@ PyImport_ReloadModule(m)
|
||||||
if (parentname == NULL)
|
if (parentname == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
parent = PyDict_GetItem(modules, parentname);
|
parent = PyDict_GetItem(modules, parentname);
|
||||||
|
Py_DECREF(parentname);
|
||||||
if (parent == NULL) {
|
if (parent == NULL) {
|
||||||
PyErr_Format(PyExc_ImportError,
|
PyErr_Format(PyExc_ImportError,
|
||||||
"reload(): parent %.200s not in sys.modules",
|
"reload(): parent %.200s not in sys.modules",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue