diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-10-23 05:41:45 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-10-23 05:41:45 +0400 |
commit | 6e7e8a1a910ec00511acc7c98653f57613ec5d0b (patch) | |
tree | 6d28a6f32249aec50d5cba59a0c01a82aa7904d4 | |
parent | 0e51f714d107584668438742c4fb1c631c629061 (diff) |
uloop: fix a segfault on deleting the first active timer from within another timer
-rw-r--r-- | uloop.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -464,9 +464,11 @@ static int uloop_get_next_timeout(struct timeval *tv) static void uloop_process_timeouts(struct timeval *tv) { - struct uloop_timeout *t, *tmp; + struct uloop_timeout *t; + + while (!list_empty(&timeouts)) { + t = list_first_entry(&timeouts, struct uloop_timeout, list); - list_for_each_entry_safe(t, tmp, &timeouts, list) { if (tv_diff(&t->time, tv) > 0) break; |