mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
builtin_map(): Nailed memory leak. PyList_Append() borrows a
reference, so you have to DECREF the appended value. This was a fun one!
This commit is contained in:
parent
f988e687a1
commit
2133287c3e
1 changed files with 1 additions and 0 deletions
|
@ -903,6 +903,7 @@ builtin_map(self, args)
|
|||
if (i >= len) {
|
||||
if (PyList_Append(result, value) < 0)
|
||||
goto Fail_1;
|
||||
Py_DECREF(value);
|
||||
}
|
||||
else {
|
||||
if (PyList_SetItem(result, i, value) < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue