summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-01-28 04:21:35 (GMT)
committerBarry Warsaw <barry@python.org>1999-01-28 04:21:35 (GMT)
commit2133287c3ed12557cb1dde84ffe928e1f04eeda9 (patch)
tree062ac515b39fe617586b36dbb02e182377b43775 /Python
parentf988e687a1f0251c36fe620e5f562c113f338cd9 (diff)
downloadcpython-2133287c3ed12557cb1dde84ffe928e1f04eeda9.zip
cpython-2133287c3ed12557cb1dde84ffe928e1f04eeda9.tar.gz
cpython-2133287c3ed12557cb1dde84ffe928e1f04eeda9.tar.bz2
builtin_map(): Nailed memory leak. PyList_Append() borrows a
reference, so you have to DECREF the appended value. This was a fun one!
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index df6b98b..1929ae9 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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)