Commit 284fa08e authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #14761: Fix potential leak on an error case in the import machinery.

parent 5ec0340c
...@@ -127,6 +127,7 @@ Tony Campbell ...@@ -127,6 +127,7 @@ Tony Campbell
Brett Cannon Brett Cannon
Mike Carlton Mike Carlton
Terry Carroll Terry Carroll
Damien Cassou
Lorenzo M. Catucci Lorenzo M. Catucci
Donn Cave Donn Cave
Charles Cazabon Charles Cazabon
......
...@@ -9,6 +9,8 @@ What's New in Python 2.7.4 ...@@ -9,6 +9,8 @@ What's New in Python 2.7.4
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #14761: Fix potential leak on an error case in the import machinery.
- Issue #14699: Fix calling the classmethod descriptor directly. - Issue #14699: Fix calling the classmethod descriptor directly.
- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError - Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
......
...@@ -998,7 +998,7 @@ load_source_module(char *name, char *pathname, FILE *fp) ...@@ -998,7 +998,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
FILE *fpc; FILE *fpc;
char *buf; char *buf;
char *cpathname; char *cpathname;
PyCodeObject *co; PyCodeObject *co = NULL;
PyObject *m; PyObject *m;
if (fstat(fileno(fp), &st) != 0) { if (fstat(fileno(fp), &st) != 0) {
...@@ -1054,6 +1054,7 @@ load_source_module(char *name, char *pathname, FILE *fp) ...@@ -1054,6 +1054,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
return m; return m;
error_exit: error_exit:
Py_XDECREF(co);
PyMem_FREE(buf); PyMem_FREE(buf);
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