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:
Barry Warsaw 1999-01-27 17:54:20 +00:00
parent 54ecc3d24f
commit 3879333b9e
1 changed files with 1 additions and 0 deletions

View File

@ -1800,6 +1800,7 @@ PyImport_ReloadModule(m)
if (parentname == NULL)
return NULL;
parent = PyDict_GetItem(modules, parentname);
Py_DECREF(parentname);
if (parent == NULL) {
PyErr_Format(PyExc_ImportError,
"reload(): parent %.200s not in sys.modules",