rc-logger.c: fix crash on fclose(NULL) (#137)
Only close the log if we successfully opened it. Reported-by: Brian Evans <grknight@gentoo.org> Tested-by: Brian Evans <grknight@gentoo.org> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
This commit is contained in:
parent
ec27299f4b
commit
7185e242ff
@ -261,12 +261,12 @@ rc_logger_open(const char *level)
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(log);
|
||||
} else {
|
||||
log_error = 1;
|
||||
eerror("Error: fopen(%s) failed: %s", TMPLOG, strerror(errno));
|
||||
}
|
||||
|
||||
fclose(log);
|
||||
fclose(plog);
|
||||
} else {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user