Dont reference transaction set from transaction elements
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 5 Apr 2011 14:33:12 +0000 (17:33 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 5 Apr 2011 14:33:12 +0000 (17:33 +0300)
- Elements referencing ts prevents rpmtsFree() from freeing anything
  unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
  from commit 8f7c2d7063df6d1057425d014ce4168d46c5e7d9.

lib/rpmte.c

index 860b3f4..dfd7b6f 100644 (file)
@@ -291,7 +291,6 @@ rpmte rpmteFree(rpmte te)
        rpmfsFree(te->fs);
        rpmpsFree(te->probs);
        rpmteCleanDS(te);
-       rpmtsFree(te->ts);
 
        argvFree(te->collections);
        argvFree(te->lastInCollectionsAny);
@@ -308,7 +307,7 @@ rpmte rpmteNew(rpmts ts, Header h, rpmElementType type, fnpyKey key,
               rpmRelocation * relocs)
 {
     rpmte p = xcalloc(1, sizeof(*p));
-    p->ts = rpmtsLink(ts);
+    p->ts = ts;
     p->type = type;
     addTE(p, h, key, relocs);
     switch (type) {