diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-25 00:53:42 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-25 00:53:42 (EST) |
commit | 8bd175b4a8150c389d8164b90342b203dda47444 (patch) | |
tree | d5746bc07018fb07cf027fe02e4aed21cc5b7909 /libopkg | |
parent | 76bcf4ec07e560ce724744bbbc71781dee35307b (diff) |
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
Diffstat (limited to 'libopkg')
-rw-r--r-- | libopkg/opkg_remove.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |