From: Jo-Philipp Wich Date: Thu, 16 Feb 2017 10:50:02 +0000 (+0100) Subject: libopkg: free old provides list in pkg_merge() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=eb39925f7d9d3c7787bd6ea60748d699d5051b19;p=project%2Fopkg-lede.git libopkg: free old provides list in pkg_merge() Signed-off-by: Jo-Philipp Wich --- 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)) {