reset buffer when free

pull/985/head
Darien Raymond 2018-03-12 16:24:31 +01:00
parent 5bbece14af
commit 0c213ccd20
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 0 deletions

View File

@ -47,6 +47,7 @@ func newBytes(size uint32) []byte {
func freeBytes(b []byte) { func freeBytes(b []byte) {
size := uint32(cap(b)) size := uint32(cap(b))
b = b[0:cap(b)]
for i := numPools - 1; i >= 0; i-- { for i := numPools - 1; i >= 0; i-- {
ps := poolSize[i] ps := poolSize[i]
if size >= ps { if size >= ps {