From: Steinar H. Gunderson Date: Fri, 19 Apr 2013 17:57:15 +0000 (+0200) Subject: Do not crash on re-exec if we do not have an access log. X-Git-Tag: 1.0.0~66 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=478d39996e950ef31d9c2de74c72890060b21260 Do not crash on re-exec if we do not have an access log. --- diff --git a/accesslog.cpp b/accesslog.cpp index f8ee50b..3183a10 100644 --- a/accesslog.cpp +++ b/accesslog.cpp @@ -89,9 +89,11 @@ void AccessLogThread::do_work() continue; } } - - if (fclose(logfp) == EOF) { - log_perror("fclose"); + + if (logfp != NULL) { + if (fclose(logfp) == EOF) { + log_perror("fclose"); + } } logfp = NULL;