From: Max Khon Date: Tue, 19 Jul 2022 12:19:12 +0000 (+0300) Subject: xlat_func_subst: do not add an additional self-reference (#4621) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3425b63113f14f8834e45a2b7f3f13222f2a25f8;p=thirdparty%2Ffreeradius-server.git xlat_func_subst: do not add an additional self-reference (#4621) Fixes the following talloc error when %(subst) is used: ERROR: talloc_free with references at src/lib/util/value.c:3425 reference at src/lib/util/value.c:3982 --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 1ad6641e3a4..d677ee3cd61 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -3295,7 +3295,7 @@ static xlat_action_t xlat_func_subst(TALLOC_CTX *ctx, fr_dcursor_t *out, p = q + pattern_len; } - if (fr_value_box_bstrdup_buffer_shallow(vb, vb, NULL, vb_str, subject_vb->tainted) < 0) { + if (fr_value_box_bstrdup_buffer_shallow(NULL, vb, NULL, vb_str, subject_vb->tainted) < 0) { RPEDEBUG("Failed creating output box"); talloc_free(vb); return XLAT_ACTION_FAIL;