From: Alan T. DeKok Date: Sun, 4 Feb 2024 13:11:15 +0000 (-0500) Subject: just call common function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d3c4b4f7cdcc110df5dfbc5b38b0900cb4f2575;p=thirdparty%2Ffreeradius-server.git just call common function --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 171348abcaa..a1bbd41cf9d 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -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