From: Michael Schroeder Date: Tue, 30 Jan 2018 09:48:20 +0000 (+0100) Subject: Fix memory leaks in LIBRPM code X-Git-Tag: 0.6.31~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bdcce1f41a8a12ce4ca1b5ac9502a8ddca4a6e4;p=thirdparty%2Flibsolv.git Fix memory leaks in LIBRPM code --- diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 57205d31..8b85697e 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -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;