Fix two smal memory leaks discovered by Vadim Chugunov.
This commit is contained in:
parent
f811dcab78
commit
b68cd421e1
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue