From: Alan T. DeKok Date: Tue, 7 Dec 2021 20:01:36 +0000 (-0500) Subject: minor cleanups X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c156d3de4afea122240cb28744f13d7434124a;p=thirdparty%2Ffreeradius-server.git minor cleanups --- diff --git a/src/lib/unlang/edit.c b/src/lib/unlang/edit.c index a0cd622a11e..1a99a03487f 100644 --- a/src/lib/unlang/edit.c +++ b/src/lib/unlang/edit.c @@ -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 */ /*