From 90582c6103071cf73f79e7dcc2a260298aadf554 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sun, 8 Mar 2009 17:25:45 +0200 Subject: [PATCH] Dont bother retrieving altNEVR unless actually needed --- lib/transaction.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/transaction.c b/lib/transaction.c index c05aef8..683b027 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -75,13 +75,10 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi, rpm_color_t tscolor = rpmtsColor(ts); rpm_color_t prefcolor = rpmtsPrefColor(ts); rpm_color_t oFColor, FColor; - char * altNEVR = NULL; rpmps ps; unsigned int fx = rpmfiFX(fi); rpmfs fs = rpmteGetFileStates(p); - altNEVR = headerGetNEVRA(otherHeader, NULL); - ps = rpmtsProblems(ts); int isCfgFile; @@ -112,11 +109,13 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi, } if (rConflicts) { + char *altNEVR = headerGetNEVRA(otherHeader, NULL); rpmpsAppend(ps, RPMPROB_FILE_CONFLICT, rpmteNEVRA(p), rpmteKey(p), rpmfiDN(fi), rpmfiBN(fi), altNEVR, 0); + free(altNEVR); } /* Save file identifier to mark as state REPLACED. */ @@ -138,7 +137,6 @@ static int handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi, rpmfiSetFReplacedSize(fi, rpmfiFSize(otherFi)); ps = rpmpsFree(ps); - altNEVR = _free(altNEVR); return 0; } -- 2.7.4