diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-03-01 15:02:24 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-03-01 15:02:24 (GMT) |
commit | 224003baefa6629f8516f4881a0da0c6f2d304a9 (patch) | |
tree | 384a553d2d40322d65f86e98a5713862f408352d /Python | |
parent | 1f2dac5766dd65924cd6cc38492d335234c1086e (diff) | |
download | cpython-224003baefa6629f8516f4881a0da0c6f2d304a9.zip cpython-224003baefa6629f8516f4881a0da0c6f2d304a9.tar.gz cpython-224003baefa6629f8516f4881a0da0c6f2d304a9.tar.bz2 |
Add missing DECREF.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pyarena.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/pyarena.c b/Python/pyarena.c index 3a2e65c..1af8a87 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; } |