]> granicus.if.org Git - python/commitdiff
SF bug #425836: Reference leak in filter().
authorTim Peters <tim.peters@gmail.com>
Mon, 21 May 2001 08:07:05 +0000 (08:07 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 21 May 2001 08:07:05 +0000 (08:07 +0000)
Mark Hammond claimed that the iterized filter() forgot to decref the
iterator upon return.  He was right!

Python/bltinmodule.c

index b647f3b74d2aa8dd391633fec4d81778d337bc33..78e2f370b8978628d3624d669dd98089b40fc145 100644 (file)
@@ -264,6 +264,7 @@ builtin_filter(PyObject *self, PyObject *args)
        if (j < len && PyList_SetSlice(result, j, len, NULL) < 0)
                goto Fail_result_it;
 
+       Py_DECREF(it);
        return result;
 
 Fail_result_it: