]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
do not talloc_free() pre-existing dict on error
authorAlan T. DeKok <aland@freeradius.org>
Tue, 19 Aug 2025 12:41:51 +0000 (08:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 19 Aug 2025 13:37:37 +0000 (09:37 -0400)
src/lib/util/dict_tokenize.c

index 47f8ddb5ff5c2a5963c255975311ff528edc352f..a826f1d837aecf9bfa2ce1ce8fb826b4cfb6b84d 100644 (file)
@@ -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