]> jfr.im git - irc/quakenet/newserv.git/commitdiff
core: don't try and close a FILE * that might be NULL without checking
authorsplidge <redacted>
Wed, 18 Mar 2009 22:58:06 +0000 (22:58 +0000)
committersplidge <redacted>
Wed, 18 Mar 2009 22:58:06 +0000 (22:58 +0000)
      first.

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, ... ) {