Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 9971:0390af6acf7f legacy-trunk
PyImport_ReloadModule(): Nailed a small memory leak. In the
else-clause of the subname test, the parentname object was never
DECREF'd.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Wed, 27 Jan 1999 17:54:20 +0000 |
| parents | 8b61e1273b4b |
| children | d834ecdf8c26 |
line wrap: on
line diff
--- a/Python/import.c Wed Jan 27 17:53:11 1999 +0000 +++ b/Python/import.c Wed Jan 27 17:54:20 1999 +0000 @@ -1800,6 +1800,7 @@ 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",
