Fix segfault in tc-set if olsrd is stopped before seeing a single node
authorHenning Rogge <hrogge@googlemail.com>
Wed, 7 Oct 2009 14:02:17 +0000 (16:02 +0200)
committerHenning Rogge <hrogge@googlemail.com>
Wed, 7 Oct 2009 14:02:17 +0000 (16:02 +0200)
src/tc_set.c

index db85796..aae82fb 100644 (file)
@@ -908,9 +908,11 @@ olsr_delete_all_tc_entries(void) {
 
 
   /* kill tc_myself */
-  olsr_delete_tc_entry(tc_myself);
-  olsr_unlock_tc_entry(tc_myself);
-  tc_myself = NULL;
+  if (tc_myself) {
+    olsr_delete_tc_entry(tc_myself);
+    olsr_unlock_tc_entry(tc_myself);
+    tc_myself = NULL;
+  }
 }
 
 static uint8_t