Browse Source

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

pull/2332/head
Antoine Pitrou 14 years ago
parent
commit
284fa08eb7
  1. 1
      Misc/ACKS
  2. 2
      Misc/NEWS
  3. 3
      Python/import.c

1
Misc/ACKS

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

2
Misc/NEWS

@ -9,6 +9,8 @@ What's New in Python 2.7.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 #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError

3
Python/import.c

@ -998,7 +998,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) {
@ -1054,6 +1054,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
return m;
error_exit:
Py_XDECREF(co);
PyMem_FREE(buf);
return NULL;
}

Loading…
Cancel
Save