]> git.meshlink.io Git - meshlink/blobdiff - src/net.c
Never call timeout_set() outside callbacks if no callback is set.
[meshlink] / src / net.c
index ce999cba00aebe133d3bb41a36c1d5b1a298ff57..22f8287ff70a232acc2ab8c7f7091308c47f0304 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -713,9 +713,11 @@ void retry(meshlink_handle_t *mesh) {
        }
 
        /* Kick the ping timeout handler */
-       timeout_set(&mesh->loop, &mesh->pingtimer, &(struct timespec) {
-               0, 0
-       });
+       if(mesh->pingtimer.cb) {
+               timeout_set(&mesh->loop, &mesh->pingtimer, &(struct timespec) {
+                       0, 0
+               });
+       }
 }
 
 /*