From 456c6a276308d9c4e9f641490f9c461cc3732bc4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 27 Dec 2008 16:37:43 +0100 Subject: [PATCH] depends: fix a leak while destroying the simple queue. --HG-- extra : convert_revision : aabc102f55fd81bce8b007d209596d40576eb8a5 --- lib/depends.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 5ef4bbc61b..3217b311e8 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -94,10 +94,12 @@ xbps_clean_pkg_depslist(void) { struct pkg_dependency *dep; - SIMPLEQ_FOREACH(dep, &pkg_deps_queue, deps) { - SIMPLEQ_REMOVE(&pkg_deps_queue, dep, pkg_dependency, deps); + while (!SIMPLEQ_EMPTY(&pkg_deps_queue)) { + dep = SIMPLEQ_FIRST(&pkg_deps_queue); + SIMPLEQ_REMOVE_HEAD(&pkg_deps_queue, deps); free(dep->name); prop_object_release(dep->repo); + free(dep); } }