projects
/
oweals
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72fec39
)
Fix memory corruption when reloading static leases
author
Steven Barth
<steven@midlink.org>
Sat, 18 Jan 2014 09:55:56 +0000
(10:55 +0100)
committer
Steven Barth
<steven@midlink.org>
Sat, 18 Jan 2014 09:55:56 +0000
(10:55 +0100)
src/config.c
patch
|
blob
|
history
diff --git
a/src/config.c
b/src/config.c
index 05eb8248c99cafc2db1b84b04e286ca04c8303e6..8e42ffa5ce75fccca09d36ad98ea0564717ee8f8 100644
(file)
--- 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);