From 2133287c3ed12557cb1dde84ffe928e1f04eeda9 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 28 Jan 1999 04:21:35 +0000 Subject: builtin_map(): Nailed memory leak. PyList_Append() borrows a reference, so you have to DECREF the appended value. This was a fun one! --- Python/bltinmodule.c | 1 + 1 file changed, 1 insertion(+) 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) -- cgit v0.12