From: Hans Dedecker Date: Tue, 14 May 2019 13:18:08 +0000 (+0200) Subject: config: use list safe iterator in lease_delete X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f98b7ee899d492d32c4d857aa068daf95ae5be7b;p=oweals%2Fodhcpd.git 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 --- 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);