]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
the input value-box is already allocated in the output context
authorAlan T. DeKok <aland@freeradius.org>
Sat, 17 Jan 2026 15:30:07 +0000 (10:30 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 18 Jan 2026 21:09:32 +0000 (16:09 -0500)
but if we're moving a child of a group, we do have to re-parent it.

src/lib/unlang/xlat_builtin.c

index 5f71e27487291f0f10d388361f40dbd46b060158..a46027d70f4cc6578e0457cbcc1c7aad8c2497f3 100644 (file)
@@ -71,7 +71,9 @@ typedef struct {
 void xlat_arg_copy_out(TALLOC_CTX *ctx, fr_dcursor_t *out, fr_value_box_list_t *in, fr_value_box_t *vb)
 {
        fr_value_box_list_remove(in, vb);
-       talloc_steal(ctx, vb);
+       if (talloc_parent(vb) != ctx) {
+               (void) talloc_steal(ctx, vb);
+       }
        fr_dcursor_append(out, vb);
 }