diff --git a/lib/rpmal.c b/lib/rpmal.c index db85c2139..966afd075 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -816,6 +816,7 @@ rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp) if (ret != NULL && *ret != NULL) return ret; /* ... then, look for files "provided" by package. */ + ret = _free(ret); } ai = &al->index; diff --git a/lib/rpmrc.c b/lib/rpmrc.c index b720fad3b..00afa9d48 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -1440,7 +1440,8 @@ static void rpmSetVarArch(int var, const char * val, const char * arch) } } - next->value = xstrdup(val); /* XXX memory leak, hard to plug */ + next->value = _free(next->value); + next->value = xstrdup(val); next->arch = (arch ? xstrdup(arch) : NULL); } diff --git a/rpmio/macro.c b/rpmio/macro.c index 2cff4b1e2..e5b10e4a2 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1998,8 +1998,10 @@ rpmInitMacros(MacroContext mc, const char * macrofiles) continue; /* Read macros from each file. */ - for (i = 0; i < ac; i++) + for (i = 0; i < ac; i++) { (void) rpmLoadMacroFile(mc, av[i]); + av[i] = _free(av[i]); + } av = _free(av); } mfiles = _free(mfiles);