Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Checkins

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

 

 

Python checkins RSS feed   Index | Next | Previous | View Threaded


python-checkins at python

May 9, 2012, 4:30 AM

Post #1 of 1 (44 views)
Permalink
cpython (3.2): Issue #14761: Fix potential leak on an error case in the import machinery.

http://hg.python.org/cpython/rev/9de4d85e4197
changeset: 76847:9de4d85e4197
branch: 3.2
parent: 76842:597826f7f6f5
user: Antoine Pitrou <solipsis [at] pitrou>
date: Wed May 09 13:24:31 2012 +0200
summary:
Issue #14761: Fix potential leak on an error case in the import machinery.

files:
Misc/ACKS | 1 +
Misc/NEWS | 2 ++
Python/import.c | 3 ++-
3 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -145,6 +145,7 @@
Brett Cannon
Mike Carlton
Terry Carroll
+Damien Cassou
Lorenzo M. Catucci
Donn Cave
Charles Cazabon
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@
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
diff --git a/Python/import.c b/Python/import.c
--- a/Python/import.c
+++ b/Python/import.c
@@ -1293,7 +1293,7 @@
FILE *fpc;
char *buf;
char *cpathname;
- PyCodeObject *co;
+ PyCodeObject *co = NULL;
PyObject *m;

if (fstat(fileno(fp), &st) != 0) {
@@ -1350,6 +1350,7 @@
return m;

error_exit:
+ Py_XDECREF(co);
PyMem_FREE(buf);
return NULL;
}

--
Repository URL: http://hg.python.org/cpython

Python checkins RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.