Do not crash on re-exec if we do not have an access log.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:57:15 +0000 (19:57 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:57:15 +0000 (19:57 +0200)
accesslog.cpp

index f8ee50b..3183a10 100644 (file)
@@ -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;