]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't check data types when looking up children
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Aug 2019 13:35:34 +0000 (09:35 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 13 Aug 2019 13:35:34 +0000 (09:35 -0400)
We already check for da->children.  If there are no children,
then we can return, independent of data types.  The rest of the
code (i.e. adding attributes) ensures that children are added
only when necessary

src/lib/util/dict.c

index bdefbc1de37b9b194e30adad535040fb08b4b637..062fc4e5e5e987581d7f2be9f2a7e4d547efa124 100644 (file)
@@ -3621,17 +3621,6 @@ inline fr_dict_attr_t const *fr_dict_attr_child_by_num(fr_dict_attr_t const *par
 
        if (!parent->children) return NULL;
 
-       /*
-        *      Only some types can have children
-        */
-       switch (parent->type) {
-       default:
-               return NULL;
-
-       case FR_TYPE_STRUCTURAL:
-               break;
-       }
-
        /*
         *      Child arrays may be trimmed back to save memory.
         *      Check that so we don't SEGV.