From: Guido van Rossum Date: Wed, 1 Jul 1998 17:36:26 +0000 (+0000) Subject: Fix two smal memory leaks discovered by Vadim Chugunov. X-Git-Tag: v1.5.2a1~360 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b68cd421e151c78c065679948529ebef6c41d96a;p=python Fix two smal memory leaks discovered by Vadim Chugunov. --- diff --git a/Python/import.c b/Python/import.c index e5ac2b7bcf..f745a94a11 100644 --- a/Python/import.c +++ b/Python/import.c @@ -779,7 +779,6 @@ load_package(name, pathname) if (fp != NULL) fclose(fp); cleanup: - Py_XINCREF(m); Py_XDECREF(path); Py_XDECREF(file); return m; @@ -1712,8 +1711,8 @@ import_submodule(mod, subname, fullname) } buf[0] = '\0'; - fdp = find_module(subname, path, - buf, MAXPATHLEN+1, &fp); + fdp = find_module(subname, path, buf, MAXPATHLEN+1, &fp); + Py_XDECREF(path); if (fdp == NULL) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) return NULL;