]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Only run the free walker if we have a free callback
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 2 Feb 2021 11:52:17 +0000 (11:52 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 2 Feb 2021 11:52:17 +0000 (11:52 +0000)
The rest of the nodes are parented off the tree

src/lib/util/rbtree.c

index 86561d1a3785330465f73930c194ba3aba27f2d6..da0b4be251aae4056ec7700f87bd493421ef7e47 100644 (file)
@@ -112,7 +112,7 @@ static int _tree_free(rbtree_t *tree)
        /*
         *      walk the tree, deleting the nodes...
         */
-       if (tree->root != NIL) free_walker(tree, tree->root);
+       if ((tree->root != NIL) && tree->free) free_walker(tree, tree->root);
 
 #ifndef NDEBUG
        tree->magic = 0;