uloop timer: update the timeout->next->prev when adding timeout to the list
[project/relayd.git] / uloop.c
diff --git a/uloop.c b/uloop.c
index 8c85906..da418b7 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -118,6 +118,8 @@ int uloop_timeout_add(struct uloop_timeout *timeout)
 
        timeout->prev = prev;
        timeout->next = *head;
+       if (timeout->next)
+               timeout->next->prev = timeout;
        *head = timeout;
        timeout->pending = true;