Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 9e34967

Browse files
committed
Invalidate buf pointer after returning it to the pool
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
1 parent 29aeb2c commit 9e34967

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

buzhash.go

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func (b *Buzhash) NextBytes() ([]byte, error) {
4242
} else {
4343
b.err = err
4444
pool.Put(buf)
45+
b.buf = nil
4546
return nil, err
4647
}
4748
}

0 commit comments

Comments
 (0)