- Fix #1268: SIGSEGV after log_reopen.

git-svn-id: file:///svn/unbound/trunk@4177 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2017-05-22 07:20:59 +00:00
parent f8000b355e
commit 1a44a8402e
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,6 @@
22 May 2017: Wouter
- Fix #1268: SIGSEGV after log_reopen.
18 May 2017: Wouter
- Fix #1265 to use /bin/kill.
- Fix #1267: Libunbound validator/val_secalgo.c uses obsolete APIs,

View file

@ -103,8 +103,12 @@ log_init(const char* filename, int use_syslog, const char* chrootdir)
use_syslog?"syslog":(filename&&filename[0]?filename:"stderr"));
lock_quick_lock(&log_lock);
}
if(logfile && logfile != stderr)
fclose(logfile);
if(logfile && logfile != stderr) {
FILE* cl = logfile;
logfile = NULL; /* set to NULL before it is closed, so that
other threads have a valid logfile or NULL */
fclose(cl);
}
#ifdef HAVE_SYSLOG_H
if(logging_to_syslog) {
closelog();