]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
minor rearrangements
authorAlan T. DeKok <aland@freeradius.org>
Sat, 22 Mar 2025 06:05:32 +0000 (13:05 +0700)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 22 Mar 2025 06:05:32 +0000 (13:05 +0700)
src/lib/unlang/xlat_expr.c

index 8ecbae1a61663ebf6231ccc81432728ba71bea57..5c18acfc33dc114fd77c34123609a5da0cc38762 100644 (file)
@@ -3289,20 +3289,22 @@ static fr_slen_t xlat_tokenize_expression_internal(TALLOC_CTX *ctx, xlat_exp_hea
         *      If the tmpl is not resolved, then it refers to an attribute which doesn't exist.  That's an
         *      error.
         */
-       if ((node->type == XLAT_TMPL) && tmpl_is_data_unresolved(node->vpt)) {
-               if (!tmpl_require_enum_prefix) {
-                       fr_strerror_const("Unexpected text - attribute names must be prefixed with '&'");
-               } else {
-                       fr_strerror_const("Unknown attribute");
+       if (node->type == XLAT_TMPL) {
+               if (tmpl_is_data_unresolved(node->vpt)) {
+                               if (!tmpl_require_enum_prefix) {
+                                       fr_strerror_const("Unexpected text - attribute names must be prefixed with '&'");
+                               } else {
+                                       fr_strerror_const("Unknown attribute");
+                               }
+                               return -1;
                }
-               return -1;
-       }
 
-       /*
-        *      Convert raw existence checks to existence functions.
-        */
-       if (cond && (node->type == XLAT_TMPL) && tmpl_contains_attr(node->vpt)) {
-               node = xlat_exists_alloc(head, node);
+               /*
+                *      Convert raw existence checks to existence functions.
+                */
+               if (tmpl_contains_attr(node->vpt)) {
+                       if (cond) MEM(node = xlat_exists_alloc(head, node));
+               }
        }
 
        XLAT_VERIFY(node);