Close file descriptor in query logging (#11148)

Signed-off-by: Cosrider <cosrider7@gmail.com>

Signed-off-by: Cosrider <cosrider7@gmail.com>
pull/11180/head
Cosrider 2022-08-17 17:57:27 +08:00 committed by GitHub
parent 9594fa4dbd
commit af79dce8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ func logUnfinishedQueries(filename string, filesize int, logger log.Logger) {
level.Error(logger).Log("msg", "Failed to open query log file", "err", err)
return
}
defer fd.Close()
brokenJSON := make([]byte, filesize)
_, err = fd.Read(brokenJSON)