summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgoogle@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2011-10-14 21:12:32 (EDT)
committer google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2011-10-14 21:12:32 (EDT)
commit5be9eaad66fdcaf1a9b8e22412cc4b63fafb4118 (patch)
tree7773cab39d31646a4597074875ca22bd57ac215b
parentf1b3f188be7a7464cfde1e30a162878ff9a0924b (diff)
Fix a possible double-free of pkg vectors in opkg_remove_dependent_pkgs(), remove the inner free as it another free occurs anyway immediately after leaving the loop
git-svn-id: http://opkg.googlecode.com/svn/trunk@630 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg_remove.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
index 20e7d7d..5f4219b 100644
--- a/libopkg/opkg_remove.c
+++ b/libopkg/opkg_remove.c
@@ -137,10 +137,8 @@ opkg_remove_dependent_pkgs(pkg_t *pkg, abstract_pkg_t **dependents)
int err=0;
for (i = 0; i < dependent_pkgs->len; i++) {
err = opkg_remove_pkg(dependent_pkgs->pkgs[i],0);
- if (err) {
- pkg_vec_free(dependent_pkgs);
+ if (err)
break;
- }
}
pkg_vec_free(dependent_pkgs);
return err;