Skip to content

Commit

Permalink
bpo-40955: Fix memory leak in subprocess module (pythonGH-20825)
Browse files Browse the repository at this point in the history
```
Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
    #1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
    #2 0xe0305b in cfunction_call Objects/methodobject.c:546
```

Signed-off-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran committed Jun 12, 2020
1 parent e2fb8a2 commit 0d3350d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a minor memory leak in :mod:`subprocess` module when extra_groups was specified.
1 change: 1 addition & 0 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0d3350d

Please sign in to comment.