]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix memory leaks in LIBRPM code
authorMichael Schroeder <mls@suse.de>
Tue, 30 Jan 2018 09:48:20 +0000 (10:48 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 30 Jan 2018 09:48:20 +0000 (10:48 +0100)
ext/repo_rpmdb.c

index 57205d311352b95915a7848c2a237d0ec8ca200a..8b85697ec82b87617a8988fd20799005a2173937 100644 (file)
@@ -1742,6 +1742,7 @@ opendbenv(struct rpmdbstate *state)
       dbpath = solv_dupjoin("_dbpath ", rootdir, state->is_ostree ? "/usr/share/rpm" : "/var/lib/rpm");
     }
   rpmDefineMacro(NULL, dbpath, 0);
+  solv_free(dbpath);
   ts = rpmtsCreate();
   if (!ts)
     {
@@ -3217,6 +3218,8 @@ rpm_byrpmh(void *rpmstate, Header h)
 #else
   if (!h)
     return 0;
+  if (state->rpmhead)
+    headfree(state->rpmhead);
   rpmhead = state->rpmhead = headerLink(h);
 #endif
   return rpmhead;