Skip to content

Commit

Permalink
Add missing DECREF.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyhylton committed Mar 1, 2006
1 parent 1f2dac5 commit 224003b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Python/pyarena.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 224003b

Please sign in to comment.