summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-07-01 17:36:26 (GMT)
committerGuido van Rossum <guido@python.org>1998-07-01 17:36:26 (GMT)
commitb68cd421e151c78c065679948529ebef6c41d96a (patch)
treed6c38709410d3ccb21e46ab88517a88d08c8a446 /Python/import.c
parentf811dcab78d21e6d07222e84e347a96155ec9694 (diff)
downloadcpython-b68cd421e151c78c065679948529ebef6c41d96a.zip
cpython-b68cd421e151c78c065679948529ebef6c41d96a.tar.gz
cpython-b68cd421e151c78c065679948529ebef6c41d96a.tar.bz2
Fix two smal memory leaks discovered by Vadim Chugunov.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/import.c b/Python/import.c
index e5ac2b7..f745a94 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;