diff options
author | Sergei Trofimovich <slyfox@inbox.ru> | 2017-05-30 08:47:55 +0100 |
---|---|---|
committer | Doug Freed <dwfreed@mtu.edu> | 2017-05-30 03:47:55 -0400 |
commit | 7185e242ffaa8cd1b672fe4726502a196fd779c2 (patch) | |
tree | fd7dcc24db1c237b838208b5bcf225ad40b2bb5b /src/rc | |
parent | ec27299f4b88daa80261298fafea76ae634744d9 (diff) |
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>
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/rc-logger.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index b4bd0eae..062ce3d9 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -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 { /* |