]> jfr.im git - irc/quakenet/newserv.git/blobdiff - core/error.c
core: don't try and close a FILE * that might be NULL without checking
[irc/quakenet/newserv.git] / core / error.c
index edd986990bb5e7056f329c07c9c3fa5a3a403e1c..ce34a9aebcae5fd3360a69e1547e586cf930b78c 100644 (file)
@@ -49,8 +49,9 @@ void init_logfile() {
 }
 
 void fini_logfile() {
+  if (logfile) 
+    fclose(logfile);
   deregisterhook(HOOK_CORE_SIGUSR1, reopen_logfile);
-  fclose(logfile);
 }
 
 void Error(char *source, int severity, char *reason, ... ) {