From e747b18c932d05b21a2b3f03390a2997117dbcdb Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 9 Jul 2014 11:44:17 +0200 Subject: [PATCH] avltree: Don't leak memory when clearing the tree. Remove all nodes starting at the smallest instead of at the root. --- src/utils/avltree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/avltree.c b/src/utils/avltree.c index 6189d17..d8151c8 100644 --- a/src/utils/avltree.c +++ b/src/utils/avltree.c @@ -153,7 +153,7 @@ tree_clear(sdb_avltree_t *tree) { node_t *n; - n = tree->root; + n = node_smallest(tree); while (n) { node_t *tmp = node_next(n); -- 2.30.2