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

This commit is contained in:
Antoine Pitrou 2012-05-09 13:24:31 +02:00
parent b98b37f101
commit d576c711a5
3 changed files with 5 additions and 1 deletions

View File

@ -145,6 +145,7 @@ Tony Campbell
Brett Cannon
Mike Carlton
Terry Carroll
Damien Cassou
Lorenzo M. Catucci
Donn Cave
Charles Cazabon

View File

@ -10,6 +10,8 @@ What's New in Python 3.2.4
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 #14433: Prevent msvcrt crash in interactive prompt when stdin

View File

@ -1293,7 +1293,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
FILE *fpc;
char *buf;
char *cpathname;
PyCodeObject *co;
PyCodeObject *co = NULL;
PyObject *m;
if (fstat(fileno(fp), &st) != 0) {
@ -1350,6 +1350,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
return m;
error_exit:
Py_XDECREF(co);
PyMem_FREE(buf);
return NULL;
}