From: Alan T. DeKok Date: Tue, 19 Aug 2025 12:41:51 +0000 (-0400) Subject: do not talloc_free() pre-existing dict on error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c247482e296cb427c22894fba72b68b6b5ca8dd2;p=thirdparty%2Ffreeradius-server.git do not talloc_free() pre-existing dict on error --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 47f8ddb5ff5..a826f1d837a 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -2934,7 +2934,11 @@ post_option: dict->root->name, dict->root->flags.type_size, type_size); return -1; } - goto done; + + /* + * Do NOT talloc_free() dict on error. + */ + return dict_dctx_push(dctx, dict->root, NEST_NONE); } dict = dict_alloc(dict_gctx); @@ -2967,7 +2971,6 @@ post_option: mutable->flags.length = 1; /* who knows... */ } -done: /* * Make the root available on the stack, in case * something wants to begin it. Note that we mark it as