]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add dependency if we load the dictionary
authorAlan T. DeKok <aland@freeradius.org>
Sun, 4 Feb 2024 13:10:28 +0000 (08:10 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 4 Feb 2024 13:10:28 +0000 (08:10 -0500)
and thus we can call dict->proto->free()

src/lib/util/dict_tokenize.c
src/lib/util/dict_util.c

index 38fa37d9b4c324bef0e9402108ccf0054a53ea8f..c3b38c7d10c338e0cbdb74ad1862c902139cd14c 100644 (file)
@@ -2916,10 +2916,8 @@ int fr_dict_protocol_afrom_file(fr_dict_t **out, char const *proto_name, char co
                 *      When we have A->B->A, it means that we don't need to track B->A, because we track
                 *      A->B.  And if A is freed, then B is freed.
                 */
-               if (!dict->loading) {
-                       added = true;
-                       dict_dependent_add(dict, dependent);
-               }
+               added = true;
+               dict_dependent_add(dict, dependent);
 
                /*
                 *      But we only return a pre-existing dict if _this function_ has loaded it.
index 1b9618043190afea816d2b7d237b659c1be379a5..171348abcaa41e70964aa11038b8fe413c23ac8c 100644 (file)
@@ -3363,14 +3363,12 @@ static int _dict_free(fr_dict_t *dict)
        }
 #endif
 
-#if 0
        /*
         *      If we called init(), then call free()
         */
        if (dict->proto && dict->proto->free) {
                dict->proto->free();
        }
-#endif
 
        if (!fr_cond_assert(!dict->in_protocol_by_name || fr_hash_table_delete(dict->gctx->protocol_by_name, dict))) {
                fr_strerror_printf("Failed removing dictionary from protocol hash \"%s\"", dict->root->name);