mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-26 00:30:05 -04:00
Check that FILE_STREAM(channel) is not already closed
isc_log_closefilelogs can also close log files. isc_log_doit failed to check if the file handle was still valid before closing it.
This commit is contained in:
parent
6427d625ea
commit
48d39f7c30
1 changed files with 5 additions and 2 deletions
|
|
@ -1762,8 +1762,11 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
|||
errno == ENOENT) ||
|
||||
statbuf.st_size < FILE_MAXSIZE(channel))
|
||||
{
|
||||
(void)fclose(FILE_STREAM(channel));
|
||||
FILE_STREAM(channel) = NULL;
|
||||
if (FILE_STREAM(channel) != NULL) {
|
||||
(void)fclose(
|
||||
FILE_STREAM(channel));
|
||||
FILE_STREAM(channel) = NULL;
|
||||
}
|
||||
FILE_MAXREACHED(channel) = false;
|
||||
} else {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue