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 0489c1cc2cb92c2c9b69292df78995a6b1e3e81d..73d0f7d23607bb8111a19db39765a2c346fc1b72 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)) {