service: use avl_remove_all_elements()
authorFelix Fietkau <nbd@openwrt.org>
Sun, 25 May 2014 19:01:30 +0000 (21:01 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 25 May 2014 19:01:30 +0000 (21:01 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
service/validate.c

index ca9bb393c6c3f40e3ff79fcc48982d6d1f7d7ad2..2e610c7268af6cc86acf0c6e020b6847f85a9d17 100644 (file)
@@ -100,10 +100,9 @@ service_validate_del(struct service *s)
         list_for_each_entry_safe(v, n, &s->validators, list) {
                struct vrule *vr, *a;
 
-               avl_for_each_element_safe(&v->rules, vr, avl, a) {
-                       avl_delete(&v->rules, &vr->avl);
+               avl_remove_all_elements(&v->rules, vr, avl, a)
                        free(vr);
-               }
+
                avl_delete(&validators, &v->avl);
                list_del(&v->list);
                free(v);