]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't append output book on failure
authorAlan T. DeKok <aland@freeradius.org>
Mon, 21 Jul 2025 07:40:03 +0000 (09:40 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 21 Jul 2025 07:40:03 +0000 (09:40 +0200)
src/modules/rlm_test/rlm_test.c

index f65456a0fc1477f20f3e5657d9c774a455794f5e..825b0628cddcbaa9a6d57fd2321e22163e2d2661 100644 (file)
@@ -353,15 +353,13 @@ static xlat_action_t trigger_test_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
        fr_value_box_t  *in_head = fr_value_box_list_head(in);
        fr_value_box_t  *vb;
 
-       MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_BOOL, NULL));
-       fr_dcursor_append(out, vb);
-
        if (trigger(unlang_interpret_get(request), NULL, in_head->vb_strvalue, false, NULL) < 0) {
                RPEDEBUG("Running trigger failed");
-               vb->vb_bool = false;
                return XLAT_ACTION_FAIL;
        }
 
+       MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_BOOL, NULL));
+       fr_dcursor_append(out, vb);
        vb->vb_bool = true;
 
        return XLAT_ACTION_DONE;