mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
Close buf writer in event of an error (#6523)
* Close buf writer in event of an error * Merge refs/heads/master into close-bufwriter * Merge refs/heads/master into close-bufwriter
This commit is contained in:
parent
132ad5beb8
commit
8da0246702
@ -151,6 +151,10 @@ func writeSnappyBuffer(w io.Writer, b []byte) (int, error) {
|
||||
defer bufWriterPool.Put(bufWriter)
|
||||
num, err := bufWriter.Write(b)
|
||||
if err != nil {
|
||||
// Close buf writer in the event of an error.
|
||||
if err := bufWriter.Close(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
return num, bufWriter.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user