We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 573f790 commit 3d7d91fCopy full SHA for 3d7d91f
1 file changed
bytes/bytes_pool.go
@@ -72,8 +72,9 @@ func (bp *BytesPool) AcquireBytes(size int) []byte {
72
73
// ReleaseBytes ...
74
func (bp *BytesPool) ReleaseBytes(buf []byte) {
75
- idx := bp.findIndex(cap(buf))
76
- if idx >= bp.length {
+ bufCap := cap(buf)
+ idx := bp.findIndex(bufCap)
77
+ if idx >= bp.length || bp.sizes[idx] != bufCap {
78
return
79
}
80
0 commit comments