Plug a dumb memleak that has crept into rpmReadPackageFile()
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 2 Jul 2008 15:49:05 +0000 (18:49 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 2 Jul 2008 15:49:05 +0000 (18:49 +0300)
- jumps to exit from very early on, make sure sigtd is reset early so
  calling rpmtdFreeData() is safe

lib/package.c

index 16dc12b..9d95da0 100644 (file)
@@ -596,6 +596,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
 
     if (hdrp) *hdrp = NULL;
 
+    rpmtdReset(&sigtd);
     l = rpmLeadNew();
 
     if ((rc = rpmLeadRead(fd, l)) == RPMRC_OK) {
@@ -845,6 +846,7 @@ exit:
        /* Bump reference count for return. */
        *hdrp = headerLink(h);
     }
+    rpmtdFreeData(&sigtd);
     h = headerFree(h);
     pgpFreeDig(dig);
     sigh = rpmFreeSignature(sigh);