]> granicus.if.org Git - python/commitdiff
PyImport_ReloadModule(): Nailed a small memory leak. In the
authorBarry Warsaw <barry@python.org>
Wed, 27 Jan 1999 17:54:20 +0000 (17:54 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 27 Jan 1999 17:54:20 +0000 (17:54 +0000)
else-clause of the subname test, the parentname object was never
DECREF'd.

Python/import.c

index feed81cdf9b41e44cba66e16a23cd554c8ebc05a..936cbda06dd45b58d4d40d69bbed8936922093ab 100644 (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",