From: graham.gower Date: Wed, 25 Nov 2009 05:53:42 +0000 (+0000) Subject: Plug leaks found when using --force-removal-of-dependent-packages. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8bd175b4a8150c389d8164b90342b203dda47444;p=oweals%2Fopkg-lede.git Plug leaks found when using --force-removal-of-dependent-packages. git-svn-id: http://opkg.googlecode.com/svn/trunk@374 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c index e9d2f10..a4819de 100644 --- a/libopkg/opkg_remove.c +++ b/libopkg/opkg_remove.c @@ -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; }