From: Alan T. DeKok Date: Sun, 4 Feb 2024 13:10:28 +0000 (-0500) Subject: add dependency if we load the dictionary X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8717f60cfd113407a124fbe4f9c69c3e6a98f6a3;p=thirdparty%2Ffreeradius-server.git add dependency if we load the dictionary and thus we can call dict->proto->free() --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 38fa37d9b4c..c3b38c7d10c 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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. diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 1b961804319..171348abcaa 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -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);