]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
just call common function
authorAlan T. DeKok <aland@freeradius.org>
Sun, 4 Feb 2024 13:11:15 +0000 (08:11 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 4 Feb 2024 13:11:15 +0000 (08:11 -0500)
src/lib/util/dict_util.c

index 171348abcaa41e70964aa11038b8fe413c23ac8c..a1bbd41cf9dfa8ac44e6e7194fd6d52dcfa5be9a 100644 (file)
@@ -3567,22 +3567,7 @@ int fr_dict_const_free(fr_dict_t const **dict, char const *dependent)
 {
        fr_dict_t **our_dict = UNCONST(fr_dict_t **, dict);
 
-       if (!*our_dict) return 0;
-
-       switch (dict_dependent_remove(*our_dict, dependent)) {
-       case 0:         /* dependent has no more refs */
-               if (!dict_has_dependents(*our_dict)) {
-                       talloc_free(*our_dict);
-                       return 0;
-               }
-               FALL_THROUGH;
-
-       case 1:         /* dependent has more refs */
-               return 1;
-
-       default:        /* error */
-               return -1;
-       }
+       return fr_dict_free(our_dict, dependent);
 }
 
 /** Decrement the reference count on a previously loaded dictionary