From: Arran Cudbard-Bell Date: Thu, 8 Apr 2021 16:10:58 +0000 (+0100) Subject: Set the destructor on the gctx we just allocated X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05b11a52bc32f6535759580da5d577035b338db0;p=thirdparty%2Ffreeradius-server.git Set the destructor on the gctx we just allocated --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 4ed1e8acb3..7db5e65108 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -3351,8 +3351,9 @@ fr_dict_gctx_t const *fr_dict_global_ctx_init(TALLOC_CTX *ctx, char const *dict_ if (dl_symbol_init_cb_register(new_ctx->dict_loader, 0, "dict_protocol", dict_validation_onload_func, NULL) < 0) goto error; + talloc_set_destructor(new_ctx, _dict_global_free); + if (!dict_gctx) dict_gctx = new_ctx; /* Set as the default */ - talloc_set_destructor(dict_gctx, _dict_global_free); return new_ctx; }