]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
we shouldn't be using a NULL talloc_ctx.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 20 Sep 2022 18:10:32 +0000 (14:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 20 Sep 2022 19:55:35 +0000 (15:55 -0400)
and always free the result_copy, as the debug level may change
in an xlt function

src/lib/unlang/xlat_eval.c

index 402eb366e2daf0e9fe8785edd014bce25cd0c64a..d26ecff976bf6c43667abb0b65c04bc313a4e262 100644 (file)
@@ -824,7 +824,7 @@ xlat_action_t xlat_frame_eval_repeat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                 *      Need to copy the input list in case
                 *      the async function mucks with it.
                 */
-               if (RDEBUG_ENABLED2) fr_value_box_list_acopy(NULL, &result_copy, result);
+               if (RDEBUG_ENABLED2) fr_value_box_list_acopy(unlang_interpret_frame_talloc_ctx(request), &result_copy, result);
                xa = xlat_process_args(ctx, result, request, node->call.func);
                if (xa == XLAT_ACTION_FAIL) {
                        fr_dlist_talloc_free(&result_copy);
@@ -841,8 +841,8 @@ xlat_action_t xlat_frame_eval_repeat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                        REXDENT();
                        xlat_debug_log_expansion(request, *in, &result_copy, __LINE__);
                        RINDENT();
-                       fr_dlist_talloc_free(&result_copy);
                }
+               fr_dlist_talloc_free(&result_copy);
 
                switch (xa) {
                case XLAT_ACTION_FAIL: