errorlog: Check errorfile exists (#6028)

Fixes #6027
This commit is contained in:
Orestis Floros 2024-04-30 13:39:54 +02:00 committed by GitHub
parent 5834b7e824
commit e020701df1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1 @@
fix error log related crash

View File

@ -330,6 +330,9 @@ void errorlog(char *fmt, ...) {
va_end(args);
/* also log to the error logfile, if opened */
if (!errorfile) {
return;
}
va_start(args, fmt);
vfprintf(errorfile, fmt, args);
fflush(errorfile);