summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst1
-rw-r--r--Modules/_posixsubprocess.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst b/Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst
new file mode 100644
index 0000000..9a98030
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-06-12-11-55-30.bpo-40955.huixCg.rst
@@ -0,0 +1 @@
+Fix a minor memory leak in :mod:`subprocess` module when extra_groups was specified.
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index add2962..5d1691a 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -893,6 +893,7 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
if (_enable_gc(need_to_reenable_gc, gc_module)) {
pid = -1;
}
+ PyMem_RawFree(groups);
Py_XDECREF(preexec_fn_args_tuple);
Py_XDECREF(gc_module);