From: Alan T. DeKok Date: Mon, 10 Mar 2025 02:42:53 +0000 (-0400) Subject: hackity hack, until such time as we fix xlat_copy() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0df6d69037a31a07984be6a952a0178e7510e8be;p=thirdparty%2Ffreeradius-server.git hackity hack, until such time as we fix xlat_copy() because xlat_copy() expects its output to exist --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index a3433b09f9..9579bee4f2 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -39,6 +39,11 @@ RCSID("$Id$") #include #include +/* + * For xlat_exp_head_alloc(), because xlat_copy() doesn't create an output head. + */ +#include + #include /* @@ -3667,6 +3672,9 @@ tmpl_t *tmpl_copy(TALLOC_CTX *ctx, tmpl_t const *in) } else if (tmpl_contains_xlat(vpt)) { fr_assert(in->data.xlat.ex != NULL); + vpt->data.xlat.ex = xlat_exp_head_alloc(vpt); + if (!vpt->data.xlat.ex) goto error; + if (unlikely(xlat_copy(vpt, vpt->data.xlat.ex, in->data.xlat.ex) < 0)) goto error; } else if (tmpl_is_data(vpt)) {