summaryrefslogtreecommitdiffstats
path: root/Modules/_posixsubprocess.c
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2012-08-24 11:25:59 (GMT)
committerRoss Lagerwall <rosslagerwall@gmail.com>2012-08-24 11:25:59 (GMT)
commitf2b34b8b9669598d4294488cf3bb8ab4465b7097 (patch)
tree9e20c697638518a5f3a53fc5caeed47fa8193e9e /Modules/_posixsubprocess.c
parent01d183732ef458e046c3c3d16282120aa4fe3136 (diff)
downloadcpython-f2b34b8b9669598d4294488cf3bb8ab4465b7097.zip
cpython-f2b34b8b9669598d4294488cf3bb8ab4465b7097.tar.gz
cpython-f2b34b8b9669598d4294488cf3bb8ab4465b7097.tar.bz2
Issue 15777: Fix a refleak in _posixsubprocess.
It was exposed by 03c98d05b140 and dbbf3ccf72e8.
Diffstat (limited to 'Modules/_posixsubprocess.c')
-rw-r--r--Modules/_posixsubprocess.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index c93f537..59673f4 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