olsr_exit: protect against a NULL message
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 6 Nov 2015 14:22:10 +0000 (15:22 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 6 Nov 2015 14:22:10 +0000 (15:22 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/olsr.c

index 9c37043..a5eb06e 100644 (file)
@@ -558,8 +558,10 @@ olsr_status_to_string(uint8_t status)
 void
 olsr_exit(const char *msg, int val)
 {
-  OLSR_PRINTF(1, "OLSR EXIT: %s\n", msg);
-  olsr_syslog(OLSR_LOG_ERR, "olsrd exit: %s\n", msg);
+  if (msg) {
+    OLSR_PRINTF(1, "OLSR EXIT: %s\n", msg);
+    olsr_syslog(OLSR_LOG_ERR, "olsrd exit: %s\n", msg);
+  }
   fflush(stdout);
 
   if (olsr_cnf) {