]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
xlat_func_subst: do not add an additional self-reference (#4621)
authorMax Khon <fjoe@samodelkin.net>
Tue, 19 Jul 2022 12:19:12 +0000 (15:19 +0300)
committerGitHub <noreply@github.com>
Tue, 19 Jul 2022 12:19:12 +0000 (08:19 -0400)
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

src/lib/unlang/xlat_builtin.c

index 1ad6641e3a4f03147cd3b5c5f68f5bfb0c2659f9..d677ee3cd61202642da8fc417df684cf9d2a34f0 100644 (file)
@@ -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;