]> granicus.if.org Git - python/commitdiff
Issue #14125: Fix multiprocessing refleak on Windows. Patch by sbt.
authorStefan Krah <skrah@bytereef.org>
Mon, 27 Feb 2012 12:51:02 +0000 (13:51 +0100)
committerStefan Krah <skrah@bytereef.org>
Mon, 27 Feb 2012 12:51:02 +0000 (13:51 +0100)
Modules/_multiprocessing/win32_functions.c

index e1759971cbd2d5ecd73dfb0a09dc54663850c648..15aeedae3302f00152d32dac0ff4c390a7b017c0 100644 (file)
@@ -708,9 +708,12 @@ win32_WaitForMultipleObjects(PyObject* self, PyObject* args)
         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 */