From 3c6b148a676f95e074b5cf6b5c7c060f65d0a16d Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 21 May 2001 08:07:05 +0000 Subject: [PATCH] SF bug #425836: Reference leak in filter(). Mark Hammond claimed that the iterized filter() forgot to decref the iterator upon return. He was right! --- Python/bltinmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index b647f3b74d2..78e2f370b89 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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: