From: Barry Warsaw Date: Wed, 27 Jan 1999 17:54:20 +0000 (+0000) Subject: PyImport_ReloadModule(): Nailed a small memory leak. In the X-Git-Tag: v1.5.2b2~257 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3879333b9eef62541a68d8c7fd3e95e544a1ebda;p=thirdparty%2FPython%2Fcpython.git PyImport_ReloadModule(): Nailed a small memory leak. In the else-clause of the subname test, the parentname object was never DECREF'd. --- diff --git a/Python/import.c b/Python/import.c index feed81cdf9b4..936cbda06dd4 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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",