From cbe0b87a7bc7d785eb945ec87305e99a32e30229 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 28 Jan 2012 17:53:31 +0100 Subject: [PATCH] Fix a memory leak in generation of a list. --- python/src/repo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/src/repo.c b/python/src/repo.c index a869d6e0f..6621c3bff 100644 --- a/python/src/repo.c +++ b/python/src/repo.c @@ -188,6 +188,9 @@ PyObject *Repo_get_all(RepoObject *self) { Id p; Repo *r = self->_repo; + assert(r != NULL); + assert(r->pool != NULL); + PyObject *list = PyList_New(0); FOR_REPO_SOLVABLES(r, p, s) { @@ -197,12 +200,12 @@ PyObject *Repo_get_all(RepoObject *self) { if (solv == NULL) return NULL; - solv->_pool = self->_repo->pool; + solv->_pool = r->pool; solv->_id = p; PyList_Append(list, (PyObject *)solv); + Py_DECREF(solv); } - Py_INCREF(list); return list; } -- 2.39.5