check if global config object is not null
@@ -53,7 +53,7 @@ void log_print(int priority, const char format[], ...)
time = "";
#endif
- if (gconf->use_syslog) {
+ if (gconf != NULL && gconf->use_syslog) {
// Write messages to e.g. /var/log/syslog
openlog(MAIN_SRVNAME, LOG_PID | LOG_CONS, LOG_USER | LOG_PERROR);
syslog(priority, "%s%s", time, buf);
