summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-01-18 10:55:56 +0100
committerSteven Barth <steven@midlink.org>2014-01-18 10:55:56 +0100
commit9d050fcefd335f4cc0d8ddbabebb99954abe8904 (patch)
tree77a63bb044d58e386d4c89b0b49fc9286ee1d554 /src
parent72fec39d4446d9bb9416763043c79d5135c84fbd (diff)
Fix memory corruption when reloading static leases
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 05eb824..8e42ffa 100644
--- a/src/config.c
+++ b/src/config.c
@@ -517,8 +517,8 @@ static int set_interface(struct uci_section *s)
void odhcpd_reload(void)
{
struct uci_context *uci = uci_alloc_context();
- struct lease *l;
- list_for_each_entry(l, &leases, head) {
+ while (!list_empty(&leases)) {
+ struct lease *l = list_first_entry(&leases, struct lease, head);
list_del(&l->head);
free(l->duid);
free(l);