Add missing DECREF.

This commit is contained in:
Jeremy Hylton 2006-03-01 15:02:24 +00:00
parent 1f2dac5766
commit 224003baef
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}