From 8bd175b4a8150c389d8164b90342b203dda47444 Mon Sep 17 00:00:00 2001 From: graham.gower Date: Wed, 25 Nov 2009 00:53:42 -0500 Subject: 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 --- (limited to 'libopkg') 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; } -- cgit v0.9.1