From: Sebastian Harl Date: Wed, 9 Jul 2014 09:44:17 +0000 (+0200) Subject: avltree: Don't leak memory when clearing the tree. X-Git-Tag: sysdb-0.3.0~67 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e747b18c932d05b21a2b3f03390a2997117dbcdb;p=sysdb.git avltree: Don't leak memory when clearing the tree. Remove all nodes starting at the smallest instead of at the root. --- 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);