summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2006-03-01 15:02:24 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2006-03-01 15:02:24 +0000
commit4c532920f495d0fc06c4ce7c7db8a362da2eddc8 (patch)
tree1c422bdb1daeb0297270d46b885568dcbef891c9 /Python
parentd4f81ed6e6c2e7678b580dcfde56c863576e1c11 (diff)
downloadcpython-4c532920f495d0fc06c4ce7c7db8a362da2eddc8.tar.gz
Add missing DECREF.
Diffstat (limited to 'Python')
-rw-r--r--Python/pyarena.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/pyarena.c b/Python/pyarena.c
index 3a2e65ca59..1af8a87c87 100644
--- a/Python/pyarena.c
+++ b/Python/pyarena.c
@@ -159,5 +159,9 @@ PyArena_Malloc(PyArena *arena, size_t size)
int
PyArena_AddPyObject(PyArena *arena, PyObject *obj)
{
- return PyList_Append(arena->a_objects, obj) >= 0;
+ int r = PyList_Append(arena->a_objects, obj);
+ if (r >= 0) {
+ Py_DECREF(obj);
+ }
+ return r;
}