[Python-checkins] cpython (3.2): Issue 15777: Fix a refleak in _posixsubprocess.

ross.lagerwall python-checkins at python.org
Fri Aug 24 13:37:28 CEST 2012


http://hg.python.org/cpython/rev/081507b4ae40
changeset:   78724:081507b4ae40
branch:      3.2
parent:      78715:a377a4298b4e
user:        Ross Lagerwall <rosslagerwall at gmail.com>
date:        Fri Aug 24 13:25:59 2012 +0200
summary:
  Issue 15777: Fix a refleak in _posixsubprocess.

It was exposed by 03c98d05b140 and dbbf3ccf72e8.

files:
  Misc/NEWS                  |  2 ++
  Modules/_posixsubprocess.c |  4 +++-
  2 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -109,6 +109,8 @@
 Library
 -------
 
+- Issue #15777: Fix a refleak in _posixsubprocess.
+
 - Issue #15199: Fix JavaScript's default MIME type to application/javascript.
   Patch by Bohuslav Kabrda.
 
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -566,8 +566,10 @@
     }
 
     exec_array = _PySequence_BytesToCharpArray(executable_list);
-    if (!exec_array)
+    if (!exec_array) {
+        Py_XDECREF(gc_module);
         return NULL;
+    }
 
     /* Convert args and env into appropriate arguments for exec() */
     /* These conversions are done in the parent process to avoid allocating

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


More information about the Python-checkins mailing list