list_insert_tail(todo_list, e->to);
}
- next = node->next; /* Because the list_insert_tail() above could have added something extra for us! */
- list_delete_node(todo_list, node);
+ list_next = list_node->next; /* Because the list_insert_tail() above could have added something extra for us! */
+ list_delete_node(todo_list, list_node);
}
list_free(todo_list);
if(!reachable) {
mesh->last_unreachable = mesh->loop.now.tv_sec;
- if(mesh->threadstarted) {
+ if(mesh->threadstarted && mesh->periodictimer.cb) {
timeout_set(&mesh->loop, &mesh->periodictimer, &(struct timespec) {
0, prng(mesh, TIMER_FUDGE)
});