From 96a117c55833c5a08c7ac823a0462a633f65ae53 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 5 Oct 2014 07:09:40 +0200 Subject: [PATCH] lib/repo_pkgdeps.c: fix a double free in error branch (CID 62754) --- lib/repo_pkgdeps.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/repo_pkgdeps.c b/lib/repo_pkgdeps.c index c72adc7c..4c3c41fb 100644 --- a/lib/repo_pkgdeps.c +++ b/lib/repo_pkgdeps.c @@ -67,10 +67,9 @@ store_dependency(struct xbps_handle *xhp, xbps_array_add_cstring(replaces, self_replaced); free(self_replaced); - if (!xbps_dictionary_set(repo_pkgd, "replaces", replaces)) { - free(pkgname); + if (!xbps_dictionary_set(repo_pkgd, "replaces", replaces)) return EINVAL; - } + /* * Add the dictionary into the unsorted queue. */