mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00: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:
@@ -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 {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user