Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.9] bpo-40955: Fix memory leak in subprocess module (GH-20825) #20831

Merged
merged 1 commit into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-40955: Fix memory leak in subprocess module (GH-20825)
```
Direct leak of 8 byte(s) in 1 object(s) allocated from:
    GH-0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
    GH-1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
    GH-2 0xe0305b in cfunction_call Objects/methodobject.c:546
```

Signed-off-by: Christian Heimes <[email protected]>
(cherry picked from commit 0d3350d)

Co-authored-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran authored and miss-islington committed Jun 12, 2020
commit 76e2d454675a149ff9d1dff6c8430e447396399c
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