mirror of https://github.com/python/cpython
SF bug #425836: Reference leak in filter().
Mark Hammond claimed that the iterized filter() forgot to decref the iterator upon return. He was right!
This commit is contained in:
parent
7b87f85c78
commit
3c6b148a67
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue