summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-01-27 17:54:20 (GMT)
committerBarry Warsaw <barry@python.org>1999-01-27 17:54:20 (GMT)
commit3879333b9eef62541a68d8c7fd3e95e544a1ebda (patch)
tree5d7c1749e6a670d075ae211f73988e9eda86bf7d /Python/import.c
parent54ecc3d24f52ae45ca54a24167e434915c88b60f (diff)
downloadcpython-3879333b9eef62541a68d8c7fd3e95e544a1ebda.zip
cpython-3879333b9eef62541a68d8c7fd3e95e544a1ebda.tar.gz
cpython-3879333b9eef62541a68d8c7fd3e95e544a1ebda.tar.bz2
PyImport_ReloadModule(): Nailed a small memory leak. In the
else-clause of the subname test, the parentname object was never DECREF'd.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index feed81c..936cbda 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",