]> granicus.if.org Git - python/commitdiff
Issue 15777: Fix a refleak in _posixsubprocess.
authorRoss Lagerwall <rosslagerwall@gmail.com>
Fri, 24 Aug 2012 11:25:59 +0000 (13:25 +0200)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Fri, 24 Aug 2012 11:25:59 +0000 (13:25 +0200)
It was exposed by 03c98d05b140 and dbbf3ccf72e8.

Misc/NEWS
Modules/_posixsubprocess.c

index ae2ce66732cf8301b40681fb2173f3275256fdb8..0d76a6e3552da71e11c23d6e724e99b49f9a4bf9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -109,6 +109,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #15777: Fix a refleak in _posixsubprocess.
+
 - Issue #15199: Fix JavaScript's default MIME type to application/javascript.
   Patch by Bohuslav Kabrda.
 
index c93f5377f953f6fadce9b7942dbf97580d693938..59673f4969fd2356ce0552dc988971f65b659039 100644 (file)
@@ -566,8 +566,10 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
     }
 
     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