From: Ross Lagerwall Date: Fri, 24 Aug 2012 11:25:59 +0000 (+0200) Subject: Issue 15777: Fix a refleak in _posixsubprocess. X-Git-Tag: v3.3.0rc1~25^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2b34b8b9669598d4294488cf3bb8ab4465b7097;p=python Issue 15777: Fix a refleak in _posixsubprocess. It was exposed by 03c98d05b140 and dbbf3ccf72e8. --- diff --git a/Misc/NEWS b/Misc/NEWS index ae2ce66732..0d76a6e355 100644 --- 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. diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index c93f5377f9..59673f4969 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -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