From 5659c8226cc7b0d09ab255525f8951e35cf6ac2a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 25 May 2014 21:01:30 +0200 Subject: service: use avl_remove_all_elements() Signed-off-by: Felix Fietkau --- service/validate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); -- cgit v1.2.3