summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-07-01 17:36:26 +0000
committerGuido van Rossum <guido@python.org>1998-07-01 17:36:26 +0000
commita1183aaf1da69dd0cc881ef9f34027ac69135bd6 (patch)
tree78a7129e2c0615da66616e375942ddd4e9f771d4
parentd98bab8fc17ad6e254b78371d43d47b567eabeaa (diff)
downloadcpython-a1183aaf1da69dd0cc881ef9f34027ac69135bd6.tar.gz
Fix two smal memory leaks discovered by Vadim Chugunov.
-rw-r--r--Python/import.c5
1 files changed, 2 insertions, 3 deletions
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;