mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
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
1 changed files with 1 additions and 0 deletions
|
@ -264,6 +264,7 @@ builtin_filter(PyObject *self, PyObject *args)
|
||||||
if (j < len && PyList_SetSlice(result, j, len, NULL) < 0)
|
if (j < len && PyList_SetSlice(result, j, len, NULL) < 0)
|
||||||
goto Fail_result_it;
|
goto Fail_result_it;
|
||||||
|
|
||||||
|
Py_DECREF(it);
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
Fail_result_it:
|
Fail_result_it:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue