From: Alan T. DeKok Date: Mon, 1 Aug 2022 11:03:33 +0000 (-0400) Subject: remove all matching attributes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b2781ddddb994279cc12e4197abe8b40dcbadb0;p=thirdparty%2Ffreeradius-server.git remove all matching attributes. Which takes more time, but... --- diff --git a/src/lib/util/edit.c b/src/lib/util/edit.c index 1d1dd02200c..4a7e50e6f9d 100644 --- a/src/lib/util/edit.c +++ b/src/lib/util/edit.c @@ -805,7 +805,7 @@ static int fr_edit_list_delete_list(fr_edit_list_t *el, fr_pair_list_t *list, fr for (vp = fr_pair_list_head(to_remove); vp != NULL; vp = fr_pair_list_next(to_remove, vp)) { - fr_pair_t *found; + fr_pair_t *found, *next; /* * @todo - do this recursively. @@ -814,16 +814,17 @@ static int fr_edit_list_delete_list(fr_edit_list_t *el, fr_pair_list_t *list, fr for (found = fr_pair_find_by_da(list, NULL, vp->da); found != NULL; - found = fr_pair_find_by_da(list, found, vp->da)) { + found = next) { int rcode; + next = fr_pair_find_by_da(list, found, vp->da); + rcode = fr_value_box_cmp_op(vp->op, &vp->data, &found->data); if (rcode < 0) return -1; if (!rcode) continue; if (fr_edit_list_pair_delete(el, list, found) < 0) return -1; - break; } }