summaryrefslogtreecommitdiff
path: root/python/rpmps-py.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-12-15 11:47:47 +0200
committerPanu Matilainen <pmatilai@redhat.com>2007-12-15 11:47:47 +0200
commitb4588a1202783dd9bbee594aa5aea022ccdd3fc9 (patch)
tree01c212b49497df5241700db4f6cda987b7448df7 /python/rpmps-py.c
parent1a0a12cf159a05471be62016a318d0653ae30ff5 (diff)
downloadlibrpm-tizen-b4588a1202783dd9bbee594aa5aea022ccdd3fc9.tar.gz
librpm-tizen-b4588a1202783dd9bbee594aa5aea022ccdd3fc9.tar.bz2
librpm-tizen-b4588a1202783dd9bbee594aa5aea022ccdd3fc9.zip
Remove bogus const from rpmProblemString() return type
- its malloced so it needs to be freed - fix all users to actually free
Diffstat (limited to 'python/rpmps-py.c')
-rw-r--r--python/rpmps-py.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/rpmps-py.c b/python/rpmps-py.c
index df20140d9..4a592369c 100644
--- a/python/rpmps-py.c
+++ b/python/rpmps-py.c
@@ -68,7 +68,9 @@ fprintf(stderr, "*** rpmps_iternext(%p) ps %p psi %p\n", s, s->ps, s->psi);
/* If more to do, return a problem set string. */
if (rpmpsNextIterator(s->psi) >= 0) {
- result = Py_BuildValue("s", rpmProblemString(rpmpsGetProblem(s->psi)));
+ char * ps = rpmProblemString(rpmpsGetProblem(s->psi));
+ result = Py_BuildValue("s", ps);
+ free(ps);
} else {
s->psi = rpmpsFreeIterator(s->psi);
}
@@ -148,7 +150,9 @@ rpmps_subscript(rpmpsObject * s, PyObject * key)
psi = rpmpsInitIterator(s->ps);
while ((i = rpmpsNextIterator(psi)) >= 0) {
if (i == ix) {
- result = Py_BuildValue("s", rpmProblemString(rpmpsGetProblem(psi)));
+ char * ps = rpmProblemString(rpmpsGetProblem(psi));
+ result = Py_BuildValue("s", ps);
+ free(ps);
break;
}
}