Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Remember to decrement refcount of constructed List elements.
Browse files Browse the repository at this point in the history
After we append a constructed object to self->list, we no longer
need a reference to it. Failing to decrement its refcount results
in a memory leak.

Signed-off-by: Julien Danjou <julien@danjou.info>
  • Loading branch information
plotnick authored and tych0 committed Apr 15, 2012
1 parent 235b7aa commit e8daad4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xcb/list.c
Expand Up @@ -101,6 +101,7 @@ xpybList_init(xpybList *self, PyObject *args, PyObject *kw)

if (PyList_Append(self->list, obj) < 0)
return -1;
Py_DECREF(obj);
}

self->buf = PyBuffer_FromObject(parent, offset, cur - offset);
Expand Down

0 comments on commit e8daad4

Please sign in to comment.