From eb39925f7d9d3c7787bd6ea60748d699d5051b19 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 16 Feb 2017 11:50:02 +0100 Subject: [PATCH] libopkg: free old provides list in pkg_merge() Signed-off-by: Jo-Philipp Wich --- libopkg/pkg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libopkg/pkg.c b/libopkg/pkg.c index 0489c1c..73d0f7d 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -407,6 +407,9 @@ int pkg_merge(pkg_t * oldpkg, pkg_t * newpkg) if (!ab || !ab[0] || !ab[1]) { pkg_set_ptr(oldpkg, PKG_PROVIDES, pkg_get_ptr(newpkg, PKG_PROVIDES)); pkg_set_ptr(newpkg, PKG_PROVIDES, NULL); + + if (ab) + free(ab); } if (!pkg_get_ptr(oldpkg, PKG_CONFLICTS)) { -- 2.30.2