Commit b68cd421 authored by Guido van Rossum's avatar Guido van Rossum

Fix two smal memory leaks discovered by Vadim Chugunov.

parent f811dcab
...@@ -779,7 +779,6 @@ load_package(name, pathname) ...@@ -779,7 +779,6 @@ load_package(name, pathname)
if (fp != NULL) if (fp != NULL)
fclose(fp); fclose(fp);
cleanup: cleanup:
Py_XINCREF(m);
Py_XDECREF(path); Py_XDECREF(path);
Py_XDECREF(file); Py_XDECREF(file);
return m; return m;
...@@ -1712,8 +1711,8 @@ import_submodule(mod, subname, fullname) ...@@ -1712,8 +1711,8 @@ import_submodule(mod, subname, fullname)
} }
buf[0] = '\0'; buf[0] = '\0';
fdp = find_module(subname, path, fdp = find_module(subname, path, buf, MAXPATHLEN+1, &fp);
buf, MAXPATHLEN+1, &fp); Py_XDECREF(path);
if (fdp == NULL) { if (fdp == NULL) {
if (!PyErr_ExceptionMatches(PyExc_ImportError)) if (!PyErr_ExceptionMatches(PyExc_ImportError))
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment