all: ensure timers are set to NULL after calling olsr_stop_timer
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 25 Apr 2018 06:50:04 +0000 (08:50 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 26 Apr 2018 14:29:15 +0000 (16:29 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/dot_draw/src/olsrd_dot_draw.c
lib/info/olsrd_info.c
lib/nameservice/src/nameservice.c
src/interfaces.c

index a72f07a..4b11615 100644 (file)
@@ -152,6 +152,7 @@ olsr_plugin_exit(void)
     close(outbuffer_socket);
     abuf_free(&outbuffer);
     olsr_stop_timer(writetimer_entry);
+    writetimer_entry = NULL;
   }
   if (ipc_socket != -1) {
     CLOSE(ipc_socket);
index 294e14d..0476e70 100644 (file)
@@ -408,6 +408,7 @@ static void write_data(void *unused __attribute__((unused))) {
 
   if (!outbuffer.count) {
     olsr_stop_timer(writetimer_entry);
+    writetimer_entry = NULL;
   }
 }
 
index 36b5969..636e351 100644 (file)
@@ -507,6 +507,8 @@ name_destructor(void)
 
   olsr_stop_timer(write_file_timer);
   olsr_stop_timer(msg_gen_timer);
+  write_file_timer = NULL;
+  msg_gen_timer = NULL;
 
   regfree(&regex_t_name);
   regfree(&regex_t_service);
@@ -579,6 +581,7 @@ olsr_namesvc_delete_db_entry(struct db_entry *db)
 
   olsr_start_write_file_timer();
   olsr_stop_timer(db->db_timer);        /* stop timer if running */
+  db->db_timer = NULL;
 
   /* Delete */
   free_name_entry_list(&db->names);
index 7ebd1db..beec4f1 100644 (file)
@@ -415,6 +415,10 @@ olsr_remove_interface(struct olsr_if * iface)
   olsr_stop_timer(ifp->tc_gen_timer);
   olsr_stop_timer(ifp->mid_gen_timer);
   olsr_stop_timer(ifp->hna_gen_timer);
+  ifp->hello_gen_timer = NULL;
+  ifp->tc_gen_timer = NULL;
+  ifp->mid_gen_timer = NULL;
+  ifp->hna_gen_timer = NULL;
 
   iface->configured = 0;
   iface->interf = NULL;