]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
max_attr not incremented after partial failure
authorCatalina Pineros <catalina.pineros@inkbridge.io>
Tue, 10 Mar 2026 17:22:41 +0000 (13:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 11 Mar 2026 18:07:18 +0000 (14:07 -0400)
(found by claude code)

src/lib/unlang/compile.c

index dc2fb5657b4285100105bccd9303cbe5c7e21acf..229e8eb0a7ad356aef2513401a092dadafde8b51 100644 (file)
@@ -1986,13 +1986,13 @@ int unlang_define_local_variable(CONF_ITEM *ci, unlang_variable_t *var, tmpl_rul
        /*
         *      Copy the children over.
         */
+       var->max_attr++;
        if (fr_type_is_structural(type) && (type != FR_TYPE_GROUP)) {
                fr_fatal_assert(ref != NULL);
 
                if (fr_dict_attr_acopy_local(da, ref) < 0) goto fail;
        }
 
-       var->max_attr++;
 
        return 0;
 }