libopkg: free old provides list in pkg_merge()
authorJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 10:50:02 +0000 (11:50 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 16 Feb 2017 16:02:30 +0000 (17:02 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg.c

index 0489c1c..73d0f7d 100644 (file)
@@ -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)) {