[Python-checkins] cpython: Issue #14125: Fix multiprocessing refleak on Windows. Patch by sbt.

stefan.krah python-checkins at python.org
Mon Feb 27 13:57:24 CET 2012


http://hg.python.org/cpython/rev/ba51573fcf90
changeset:   75314:ba51573fcf90
user:        Stefan Krah <skrah at bytereef.org>
date:        Mon Feb 27 13:51:02 2012 +0100
summary:
  Issue #14125: Fix multiprocessing refleak on Windows. Patch by sbt.

files:
  Modules/_multiprocessing/win32_functions.c |  5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Modules/_multiprocessing/win32_functions.c b/Modules/_multiprocessing/win32_functions.c
--- a/Modules/_multiprocessing/win32_functions.c
+++ b/Modules/_multiprocessing/win32_functions.c
@@ -708,9 +708,12 @@
         PyObject *v = PySequence_GetItem(handle_seq, i);
         if (v == NULL)
             return NULL;
-        if (!PyArg_Parse(v, F_HANDLE, &h))
+        if (!PyArg_Parse(v, F_HANDLE, &h)) {
+            Py_DECREF(v);
             return NULL;
+        }
         handles[i] = h;
+        Py_DECREF(v);
     }
     /* If this is the main thread then make the wait interruptible
        by Ctrl-C unless we are waiting for *all* handles */

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list