Plug leaks found when using --force-removal-of-dependent-packages.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Wed, 25 Nov 2009 05:53:42 +0000 (05:53 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Wed, 25 Nov 2009 05:53:42 +0000 (05:53 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@374 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_remove.c

index e9d2f10018bf5ec8a14b37b215ad388fffbcd1fc..a4819de56336f2934ee6a3392fb51b9730e8e58b 100644 (file)
@@ -132,7 +132,7 @@ opkg_remove_dependent_pkgs (opkg_conf_t *conf, pkg_t *pkg, abstract_pkg_t **depe
     }
     
     if (count == 1) {
-        free(dependent_pkgs);  
+        pkg_vec_free(dependent_pkgs);  
        return 0;
     }
     
@@ -140,10 +140,12 @@ opkg_remove_dependent_pkgs (opkg_conf_t *conf, pkg_t *pkg, abstract_pkg_t **depe
     int err=0;
     for (i = 0; i < dependent_pkgs->len; i++) {
         err = opkg_remove_pkg(conf, dependent_pkgs->pkgs[i],0);
-        if (err)
+        if (err) {
+            pkg_vec_free(dependent_pkgs);
             break;
+       }
     }
-    free(dependent_pkgs);
+    pkg_vec_free(dependent_pkgs);
     return err;
 }