summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/_posixsubprocess.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index d8c4ea0..36bf9c3 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,8 @@ Core and Builtins
Library
-------
+- Issue #15777: Fix a refleak in _posixsubprocess.
+
- Issue ##665194: Update email.utils.localtime to use datetime.astimezone and
correctly handle historic changes in UTC offsets.
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index b8fb72f..8f0fcf2 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -568,8 +568,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