From f98b7ee899d492d32c4d857aa068daf95ae5be7b Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Tue, 14 May 2019 15:18:08 +0200 Subject: config: use list safe iterator in lease_delete As the current assignment is freed in lease_delete use list_for_each_entry_safe Signed-off-by: Hans Dedecker --- src/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/config.c b/src/config.c index f1fe82b..40f18a4 100644 --- a/src/config.c +++ b/src/config.c @@ -881,9 +881,9 @@ static void lease_change_config(struct lease *l_old, struct lease *l_new) static void lease_delete(struct lease *l) { - struct dhcp_assignment *a; + struct dhcp_assignment *a, *tmp; - list_for_each_entry(a, &l->assignments, lease_list) + list_for_each_entry_safe(a, tmp, &l->assignments, lease_list) free_assignment(a); free_lease(l); -- cgit v1.2.3