]> git.meshlink.io Git - meshlink/commitdiff
When deleting an entire tree, start at head, not at root.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 11 Nov 2006 22:45:45 +0000 (22:45 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 11 Nov 2006 22:45:45 +0000 (22:45 +0000)
lib/avl_tree.c
lib/splay_tree.c

index 27d5eec862e9583fb83e2ffab68d91a8e84b08ba..3bfdfeeeecaf1f23cd0252facf2692eabc816d13 100644 (file)
@@ -656,7 +656,7 @@ void avl_delete_tree(avl_tree_t *tree)
 {
        avl_node_t *node, *next;
 
-       for(node = tree->root; node; node = next) {
+       for(node = tree->head; node; node = next) {
                next = node->next;
                avl_free_node(tree, node);
        }
index f6e5a4bc71d250fa37e01ee627ea647610fcf142..62e9e3160b8cb8040199ef3a6d8625d769ddefc6 100644 (file)
@@ -534,7 +534,7 @@ void splay_delete(splay_tree_t *tree, void *data) {
 void splay_delete_tree(splay_tree_t *tree) {
        splay_node_t *node, *next;
 
-       for(node = tree->root; node; node = next) {
+       for(node = tree->head; node; node = next) {
                next = node->next;
                splay_free_node(tree, node);
        }