Fix some broken fooUnlink() usages
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 13 Sep 2010 10:05:55 +0000 (13:05 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 13 Sep 2010 10:05:55 +0000 (13:05 +0300)
- unreferencing should always go through fooFree() which does
  the real refcounting and frees when references go out

lib/fsm.c
lib/rpmdb.c
lib/rpmte.c
lib/rpmts.c

index d1e0adb..061e97b 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -142,7 +142,7 @@ static void * mapFreeIterator(void * p)
 /* XXX rpmswExit() */
        iter->ts = rpmtsFree(iter->ts);
        iter->te = NULL; /* XXX rpmte is not refcounted yet */
-       iter->fi = rpmfiUnlink(iter->fi);
+       iter->fi = rpmfiFree(iter->fi);
     }
     return _free(p);
 }
index a2e5eb4..e7d7f4d 100644 (file)
@@ -1276,6 +1276,7 @@ rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi)
 
     mi->mi_set = dbiFreeIndexSet(mi->mi_set);
     mi->mi_keyp = _free(mi->mi_keyp);
+    /* XXX rpmdbUnlink() should be rpmdbFree() but no such call exists... */
     mi->mi_db = rpmdbUnlink(mi->mi_db);
     mi->mi_ts = rpmtsFree(mi->mi_ts);
 
index 316ed5b..8a56601 100644 (file)
@@ -280,7 +280,7 @@ rpmte rpmteFree(rpmte te)
        rpmfsFree(te->fs);
        rpmpsFree(te->probs);
        rpmteCleanDS(te);
-       rpmtsUnlink(te->ts);
+       rpmtsFree(te->ts);
 
        argvFree(te->collections);
        argvFree(te->lastInCollectionsAny);
index 2633ff7..855e376 100644 (file)
@@ -779,7 +779,7 @@ void * rpmtsNotify(rpmts ts, rpmte te,
        ptr = ts->notify(h, what, amount, total, cbkey, ts->notifyData);
 
        if (h) {
-           headerUnlink(h); /* undo rpmteHeader() ref */
+           headerFree(h); /* undo rpmteHeader() ref */
        }
     }
     return ptr;