]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use inline API for node removal
authorAlan T. DeKok <aland@freeradius.org>
Sat, 26 Mar 2022 12:55:32 +0000 (08:55 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 26 Mar 2022 12:55:32 +0000 (08:55 -0400)
src/lib/server/cf_util.c

index 8715573dd06c57b0890cb8c5dd479a9136fd3938..b1b03afdbe6e568c1332f794eb2042bc92a01f67 100644 (file)
@@ -404,17 +404,9 @@ CONF_ITEM *_cf_item_remove(CONF_ITEM *parent, CONF_ITEM *child)
         */
        fr_dlist_remove(&parent->children, child);
 
-       in_ident1 = (fr_rb_find(parent->ident1, child) == child);
-       if (in_ident1 && (!fr_rb_delete(parent->ident1, child))) {
-               fr_assert(0);
-               return NULL;
-       }
+       in_ident1 = (fr_rb_remove_by_inline_node(parent->ident1, &child->ident1_node) != NULL);
+       in_ident2 = (fr_rb_remove_by_inline_node(parent->ident2, &child->ident2_node) != NULL);
 
-       in_ident2 = (fr_rb_find(parent->ident2, child) == child);
-       if (in_ident2 && (!fr_rb_delete(parent->ident2, child))) {
-               fr_assert(0);
-               return NULL;
-       }
 
        /*
         *      Look for twins.  They weren't in the tree initially,