diff options
| author | Barry Warsaw <barry@python.org> | 1999-01-28 04:21:35 +0000 |
|---|---|---|
| committer | Barry Warsaw <barry@python.org> | 1999-01-28 04:21:35 +0000 |
| commit | 41f5a7c0e1bd319f333be90e96dde0ce79b5f2b8 (patch) | |
| tree | 669e4ad98e1f7d6ad5f4156313caec15393b8518 /Python | |
| parent | 7dd809fda5c2d9fbf9d1dd4a80b6953f86d89993 (diff) | |
| download | cpython-41f5a7c0e1bd319f333be90e96dde0ce79b5f2b8.tar.gz | |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index df6b98b42c..1929ae92ba 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) |
