From 3879333b9eef62541a68d8c7fd3e95e544a1ebda Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 27 Jan 1999 17:54:20 +0000 Subject: [PATCH] PyImport_ReloadModule(): Nailed a small memory leak. In the else-clause of the subname test, the parentname object was never DECREF'd. --- Python/import.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/import.c b/Python/import.c index feed81cdf9b..936cbda06dd 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",