]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set the destructor on the gctx we just allocated
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 8 Apr 2021 16:10:58 +0000 (17:10 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 9 Apr 2021 11:06:42 +0000 (07:06 -0400)
src/lib/util/dict_util.c

index 4ed1e8acb3987494a1c7f99324d8b9caf1d2d4a8..7db5e65108e7ab4b2910bcacaef8fe3f8aa90f41 100644 (file)
@@ -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;
 }