summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-10-24 09:47:22 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-10-24 09:47:22 +0300
commit62cc76e25cdfad78ac30bb28f626b474efdecddc (patch)
treebddf02c09cf69ba2af7f77200be64d746b78c37a /python
parentdd8bbe42a3e357cccf6c0d3e7d63cfd76ae4bfa6 (diff)
downloadlibrpm-tizen-62cc76e25cdfad78ac30bb28f626b474efdecddc.tar.gz
librpm-tizen-62cc76e25cdfad78ac30bb28f626b474efdecddc.tar.bz2
librpm-tizen-62cc76e25cdfad78ac30bb28f626b474efdecddc.zip
Don't mess up problem pkgNEVR in python ts.check() (rhbz#349091)
Diffstat (limited to 'python')
-rw-r--r--python/rpmts-py.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index b0eaf4d66..4480dc87e 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -403,8 +403,8 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
conflicts[i].suggestedPkgs[0] : Py_None,
conflicts[i].sense);
#else
- const char * byName, * needsName;
- char * byVersion, * byRelease, *byArch;
+ const char * needsName;
+ char * byName, * byVersion, * byRelease, *byArch;
char * needsOP, * needsVersion;
int needsFlags, sense;
fnpyKey key;
@@ -415,7 +415,7 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
if (rpmProblemGetType(p) == RPMPROB_BADRELOCATE)
continue;
- byName = rpmProblemGetPkgNEVR(p);
+ byName = strdup(rpmProblemGetPkgNEVR(p));
if ((byArch= strrchr(byName, '.')) != NULL)
*byArch++ = '\0';
if ((byRelease = strrchr(byName, '-')) != NULL)
@@ -451,6 +451,7 @@ fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
#endif
PyList_Append(list, (PyObject *) cf);
Py_DECREF(cf);
+ free(byName);
}
psi = rpmpsFreeIterator(psi);