diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psm.c | 7 | ||||
-rw-r--r-- | lib/rpmfi.c | 8 |
2 files changed, 6 insertions, 9 deletions
@@ -1276,12 +1276,6 @@ assert(psm->mi == NULL); psm->mi = rpmdbFreeIterator(psm->mi); rc = RPMRC_OK; - /* XXX lazy alloc here may need to be done elsewhere. */ - if (fi->fstates == NULL && fc > 0) { - fi->fstates = xmalloc(sizeof(*fi->fstates) * fc); - memset(fi->fstates, RPMFILE_STATE_NORMAL, fc); - } - if (rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB) break; if (fc <= 0) break; @@ -1591,7 +1585,6 @@ assert(psm->mi == NULL); psm->failedFile = _free(psm->failedFile); fi->apath = _free(fi->apath); - fi->fstates = _free(fi->fstates); break; case PSM_PKGINSTALL: diff --git a/lib/rpmfi.c b/lib/rpmfi.c index a2803b5e9..26159f79e 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1266,9 +1266,13 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags) _hgfi(h, RPMTAG_FILEDEPENDSN, &td, scareFlags, fi->fddictn); } + /* XXX States not needed by TR_REMOVED */ _hgfi(h, RPMTAG_FILESTATES, &td, defFlags, fi->fstates); - if (fi->fstates == NULL) - fi->fstates = xcalloc(fi->fc, sizeof(*fi->fstates)); + if (fi->fstates == NULL) { + fi->fstates = xmalloc(sizeof(*fi->fstates) * fi->fc); + /* XXX means we show state "normal" when package not even installed */ + memset(fi->fstates, RPMFILE_STATE_NORMAL, fi->fc); + } _hgfi(h, RPMTAG_FILECAPS, &td, defFlags, fi->fcaps); |