From ac43009fc58b985549d5651b83f60be5d67a696a Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 2 Jul 2025 07:48:35 -0400 Subject: [PATCH] assert when we enter the tokenize function, not later when we call xlat_finalize(). This helps to hoist errors earlier in the call flow. --- src/lib/unlang/xlat_tokenize.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index f8519c0747..eed9bcd030 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -1851,6 +1851,8 @@ fr_slen_t xlat_tokenize(TALLOC_CTX *ctx, xlat_exp_head_t **out, fr_sbuff_t *in, fr_sbuff_t our_in = FR_SBUFF(in); xlat_exp_head_t *head; + fr_assert(!t_rules || !t_rules->at_runtime || (t_rules->xlat.runtime_el != NULL)); + MEM(head = xlat_exp_head_alloc(ctx)); fr_strerror_clear(); /* Clear error buffer */ -- 2.47.3