summaryrefslogtreecommitdiff
path: root/lib/rpmds.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-11-09 17:22:08 +0000
committerjbj <devnull@localhost>2001-11-09 17:22:08 +0000
commitac15c68ca55ee520177bfb0e1576b1069d9fbccf (patch)
tree0aef901b6c73ef250f494e90f87fe6718aae2d3d /lib/rpmds.c
parenteb10f05b8587e931bd261e99241cac2b8649d4dc (diff)
downloadlibrpm-tizen-ac15c68ca55ee520177bfb0e1576b1069d9fbccf.tar.gz
librpm-tizen-ac15c68ca55ee520177bfb0e1576b1069d9fbccf.tar.bz2
librpm-tizen-ac15c68ca55ee520177bfb0e1576b1069d9fbccf.zip
- no-brainer refcounts for rpmProblemSet object.
CVS patchset: 5163 CVS date: 2001/11/09 17:22:08
Diffstat (limited to 'lib/rpmds.c')
-rw-r--r--lib/rpmds.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index 981d096ad..667e08887 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -16,7 +16,7 @@
static int _fns_debug = 0;
/*@-shadow@*/ /* XXX copy from depends.c for now. */
-static char * hGetNVR(Header h, /*@out@*/ const char ** np)
+static char * hGetNEVR(Header h, /*@out@*/ const char ** np)
/*@modifies *np @*/
{
const char * n, * v, * r;
@@ -539,10 +539,12 @@ void dsProblem(rpmProblemSet tsprobs, Header h, const rpmDepSet ds,
const char * Name = dsiGetN(ds);
const char * DNEVR = dsiGetDNEVR(ds);
const char * EVR = dsiGetEVR(ds);
- char * byNEVR = hGetNVR(h, NULL);
+ char * pkgNEVR = hGetNEVR(h, NULL);
rpmProblemType type;
fnpyKey key;
+ if (tsprobs == NULL) return;
+
/*@-branchstate@*/
if (Name == NULL) Name = "?N?";
if (EVR == NULL) EVR = "?EVR?";
@@ -550,13 +552,14 @@ void dsProblem(rpmProblemSet tsprobs, Header h, const rpmDepSet ds,
/*@=branchstate@*/
rpmMessage(RPMMESS_DEBUG, _("package %s has unsatisfied %s: %s\n"),
- byNEVR, ds->Type, DNEVR+2);
+ pkgNEVR, ds->Type, DNEVR+2);
type = (DNEVR[0] == 'C' && DNEVR[1] == ' ')
? RPMPROB_CONFLICT : RPMPROB_REQUIRES;
key = (suggestedKeys ? suggestedKeys[0] : NULL);
- rpmProblemSetAppend(tsprobs, type, byNEVR, key,
- NULL, NULL, xstrdup(DNEVR), 0);
+ rpmProblemSetAppend(tsprobs, type, pkgNEVR, key,
+ NULL, NULL, DNEVR, 0);
+ pkgNEVR = _free(pkgNEVR);
}
int rangeMatchesDepFlags (Header h, const rpmDepSet req)