fix(stdiscosrv): close file descriptor on flush error in write (#10615)

The error path after bw.Flush() failed referenced fd.Close without calling it, so the descriptor was not closed when flush failed.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
This commit is contained in:
cui
2026-03-26 08:37:34 +08:00
committed by GitHub
parent 351be52481
commit 1106e2e332
+1 -1
View File
@@ -306,7 +306,7 @@ func (s *inMemoryStore) write() (err error) {
}
if err := bw.Flush(); err != nil {
_ = fd.Close
_ = fd.Close()
return err
}
if err := fd.Close(); err != nil {