From: Guus Sliepen Date: Thu, 5 Sep 2019 15:55:41 +0000 (+0200) Subject: Fix a potential crash when restarting the mesh. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=7c5ce220ac7492746e8579defce38729145da069 Fix a potential crash when restarting the mesh. The tv value must not be changed for a timeout that is still linked into the tree of timeouts, otherwise the tree can get corrupted. --- diff --git a/src/event.c b/src/event.c index 61e6d8d7..b58c6b6b 100644 --- a/src/event.c +++ b/src/event.c @@ -108,15 +108,8 @@ void io_del(event_loop_t *loop, io_t *io) { } void timeout_add(event_loop_t *loop, timeout_t *timeout, timeout_cb_t cb, void *data, struct timeval *tv) { - if(!timeout->cb) - timeout->tv = (struct timeval) { - 0, 0 - }; - timeout->cb = cb; - timeout->data = data; - timeout->node.data = timeout; timeout_set(loop, timeout, tv);