From 478d39996e950ef31d9c2de74c72890060b21260 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 19 Apr 2013 19:57:15 +0200 Subject: [PATCH] Do not crash on re-exec if we do not have an access log. --- accesslog.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.39.5