diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-12-02 22:03:48 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-12-02 22:03:48 (EST) |
commit | b5e40ef6ba305d7a465062dd49939b96529436c3 (patch) | |
tree | b05ffe16b641834f2e54a35348082e681a0ec1c8 | |
parent | 5c3211bb22a3cbce2f206381d8ed8a7010d72e7c (diff) |
Free memory when there are unresolved dependencies.
git-svn-id: http://opkg.googlecode.com/svn/trunk@437 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r-- | libopkg/opkg_install.c | 5 | ||||
-rw-r--r-- | libopkg/pkg_depends.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index 44aad00..a01a378 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -48,7 +48,7 @@ satisfy_dependencies_for(opkg_conf_t *conf, pkg_t *pkg) int i, err; pkg_vec_t *depends = pkg_vec_alloc(); pkg_t *dep; - char **unresolved = NULL; + char **tmp, **unresolved = NULL; int ndepends; ndepends = pkg_hash_fetch_unsatisfied_dependencies(conf, @@ -59,10 +59,13 @@ satisfy_dependencies_for(opkg_conf_t *conf, pkg_t *pkg) opkg_message(conf, OPKG_ERROR, "%s: Cannot satisfy the following dependencies for %s:\n\t", conf->force_depends ? "Warning" : "ERROR", pkg->name); + tmp = unresolved; while (*unresolved) { opkg_message(conf, OPKG_ERROR, " %s", *unresolved); + free(*unresolved); unresolved++; } + free(tmp); opkg_message(conf, OPKG_ERROR, "\n"); if (! conf->force_depends) { opkg_message(conf, OPKG_INFO, diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c index 6355fe3..9fe9a71 100644 --- a/libopkg/pkg_depends.c +++ b/libopkg/pkg_depends.c @@ -236,6 +236,8 @@ int pkg_hash_fetch_unsatisfied_dependencies(opkg_conf_t *conf, pkg_t * pkg, unsatisfied, &newstuff); the_lost = merge_unresolved(the_lost, newstuff); + if (newstuff) + free(newstuff); } } } |