util/pactree: correctly free the deps list in walk_deps()
If we are reversed, then we were correctly freeing both the list and the contained data. However, we were leaking a list in the case of a non-reversed traversal. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
60d2588192
commit
038b1815d0
1 changed files with 3 additions and 1 deletions
|
@ -472,7 +472,7 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, tdepth *depth, int r
|
||||||
depth->next = &d;
|
depth->next = &d;
|
||||||
/* last dep, cut off the limb here */
|
/* last dep, cut off the limb here */
|
||||||
if(last){
|
if(last){
|
||||||
if(depth->prev){
|
if(depth->prev) {
|
||||||
depth->prev->next = &d;
|
depth->prev->next = &d;
|
||||||
d.prev = depth->prev;
|
d.prev = depth->prev;
|
||||||
depth = &d;
|
depth = &d;
|
||||||
|
@ -488,6 +488,8 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, tdepth *depth, int r
|
||||||
|
|
||||||
if(rev) {
|
if(rev) {
|
||||||
FREELIST(deps);
|
FREELIST(deps);
|
||||||
|
} else {
|
||||||
|
alpm_list_free(deps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue