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

index 4ced580..9c37043 100644 (file)
@@ -561,7 +561,10 @@ 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);
   fflush(stdout);
-  olsr_cnf->exit_value = val;
+
+  if (olsr_cnf) {
+    olsr_cnf->exit_value = val;
+  }
 
   raise(SIGTERM);