Commit 8960ac25 authored by Antoine Pitrou's avatar Antoine Pitrou

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

parent 9d9fcfaf
...@@ -145,6 +145,7 @@ Tony Campbell ...@@ -145,6 +145,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
......
...@@ -10,6 +10,8 @@ What's New in Python 3.2.4 ...@@ -10,6 +10,8 @@ What's New in Python 3.2.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 #14433: Prevent msvcrt crash in interactive prompt when stdin - Issue #14433: Prevent msvcrt crash in interactive prompt when stdin
......
...@@ -1293,7 +1293,7 @@ load_source_module(char *name, char *pathname, FILE *fp) ...@@ -1293,7 +1293,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) {
...@@ -1350,6 +1350,7 @@ load_source_module(char *name, char *pathname, FILE *fp) ...@@ -1350,6 +1350,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