mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Add missing DECREF.
This commit is contained in:
parent
1f2dac5766
commit
224003baef
1 changed files with 5 additions and 1 deletions
|
@ -159,5 +159,9 @@ PyArena_Malloc(PyArena *arena, size_t size)
|
||||||
int
|
int
|
||||||
PyArena_AddPyObject(PyArena *arena, PyObject *obj)
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue