From: Felix Fietkau Date: Sun, 25 May 2014 19:01:30 +0000 (+0200) Subject: service: use avl_remove_all_elements() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5659c8226cc7b0d09ab255525f8951e35cf6ac2a;p=oweals%2Fprocd.git service: use avl_remove_all_elements() Signed-off-by: Felix Fietkau --- diff --git a/service/validate.c b/service/validate.c index ca9bb39..2e610c7 100644 --- a/service/validate.c +++ b/service/validate.c @@ -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);