diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2001-01-31 05:38:47 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2001-01-31 05:38:47 (GMT) |
commit | 64aae6695fa0f7677b94230540a298d686c071e3 (patch) | |
tree | 6f1ad781d8bc2940471da383df81b5714b3307b2 /Modules | |
parent | 1ff31f9534aef77c6cccebd1cda1abff14b4ebe6 (diff) | |
download | cpython-64aae6695fa0f7677b94230540a298d686c071e3.zip cpython-64aae6695fa0f7677b94230540a298d686c071e3.tar.gz cpython-64aae6695fa0f7677b94230540a298d686c071e3.tar.bz2 |
Fix Bug #125891 - os.popen2,3 and 4 leaked file objects on Windows.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 99e5864..9f44edc 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2518,6 +2518,8 @@ _PyPopen(char *cmdstring, int mode, int n) CloseHandle(hChildStderrRdDup); f = Py_BuildValue("OO",p1,p2); + Py_XDECREF(p1); + Py_XDECREF(p2); file_count = 2; break; } @@ -2548,6 +2550,9 @@ _PyPopen(char *cmdstring, int mode, int n) PyFile_SetBufSize(p2, 0); PyFile_SetBufSize(p3, 0); f = Py_BuildValue("OOO",p1,p2,p3); + Py_XDECREF(p1); + Py_XDECREF(p2); + Py_XDECREF(p3); file_count = 3; break; } |