summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2019-05-14 15:18:08 +0200
committerHans Dedecker <dedeckeh@gmail.com>2019-05-14 15:22:02 +0200
commitf98b7ee899d492d32c4d857aa068daf95ae5be7b (patch)
tree28f9327ad6917f701fa3082f5bd8684092c63001 /src
parent3c9810b24b0794028ad9ed2ef7bc18ba41d78428 (diff)
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 <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/config.c4
1 files changed, 2 insertions, 2 deletions
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);