diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-05-14 15:18:08 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-05-14 15:22:02 +0200 |
commit | f98b7ee899d492d32c4d857aa068daf95ae5be7b (patch) | |
tree | 28f9327ad6917f701fa3082f5bd8684092c63001 | |
parent | 3c9810b24b0794028ad9ed2ef7bc18ba41d78428 (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>
-rw-r--r-- | src/config.c | 4 |
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); |