From 5be9eaad66fdcaf1a9b8e22412cc4b63fafb4118 Mon Sep 17 00:00:00 2001 From: google@wwsnet.net Date: Fri, 14 Oct 2011 21:12:32 -0400 Subject: 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 --- 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; -- cgit v0.9.1