From: Panu Matilainen Date: Mon, 13 Sep 2010 11:05:02 +0000 (+0300) Subject: Eliminate broken "can't happen" early return X-Git-Tag: rpm-4.9.0-beta1~357 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6d8d0e7ed7989ce5e2d4d8133d81adc4072440c;p=platform%2Fupstream%2Frpm.git Eliminate broken "can't happen" early return - Opening RPMDBI_PACKAGES should indeed never fail, but if it does this would return way too early, leaking memory and references left and right. Also the dbi is rarely used for anything, only the rewrite mode used by markReplacedFiles() needs it, dbi is actually unused on dbiCclose() --- diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 211a289..6b09e70 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -1255,8 +1255,6 @@ rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi) } dbi = rpmdbOpenIndex(mi->mi_db, RPMDBI_PACKAGES, 0); - if (dbi == NULL) /* XXX can't happen */ - return NULL; xx = miFreeHeader(mi, dbi);