]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
minor cleanups
authorAlan T. DeKok <aland@freeradius.org>
Tue, 7 Dec 2021 20:01:36 +0000 (15:01 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 7 Dec 2021 21:02:21 +0000 (16:02 -0500)
src/lib/unlang/edit.c

index a0cd622a11e54264efd98369c6984efb5deb57eb..1a99a03487f6fb845ea39dbee5f4708f62ff359a 100644 (file)
@@ -314,7 +314,7 @@ static int apply_edits(request_t *request, unlang_frame_state_edit_t *state, map
        }
 
        talloc_free(vp_to_free);
-       goto next;
+       return 0;
 
 leaf:
        /*
@@ -344,11 +344,6 @@ leaf:
                return -1;
        }
 
-next:
-       state->state = UNLANG_EDIT_INIT;
-       TALLOC_FREE(state->lhs_free);
-       state->lhs_parent = state->lhs_vp = NULL;
-
        return 0;
 }
 
@@ -430,6 +425,8 @@ static unlang_action_t process_edit(rlm_rcode_t *p_result, request_t *request, u
                         *      parent list.
                         */
                        if (tmpl_find_vp(&state->lhs_vp, request, state->lhs) < 0) {
+                               if (map->op == T_OP_EQ) goto next;
+
                                REDEBUG("Failed to find %s", state->lhs->name);
                                goto error;
                        }
@@ -459,8 +456,15 @@ static unlang_action_t process_edit(rlm_rcode_t *p_result, request_t *request, u
                case UNLANG_EDIT_CHECK_RHS:
                check_rhs:
                        if (apply_edits(request, state, map) < 0) goto error;
+
+
+               next:
+                       state->state = UNLANG_EDIT_INIT;
+                       TALLOC_FREE(state->lhs_free);
+                       state->lhs_parent = state->lhs_vp = NULL;
                        break;
                }
+
        } /* loop over the map */
 
        /*