]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove all matching attributes.
authorAlan T. DeKok <aland@freeradius.org>
Mon, 1 Aug 2022 11:03:33 +0000 (07:03 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 5 Aug 2022 14:19:15 +0000 (10:19 -0400)
Which takes more time, but...

src/lib/util/edit.c

index 1d1dd02200ca89441d134095e46f1ad739d482ea..4a7e50e6f9de0a1274092724dbbf6d818a23e4f0 100644 (file)
@@ -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;                      
                }
        }