From 0c213ccd209a6eea213ed0d98ca1483feaa80d98 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Mon, 12 Mar 2018 16:24:31 +0100 Subject: [PATCH] reset buffer when free --- common/buf/buffer_pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/common/buf/buffer_pool.go b/common/buf/buffer_pool.go index 1c7a9ffe0..9e0cadf2c 100644 --- a/common/buf/buffer_pool.go +++ b/common/buf/buffer_pool.go @@ -47,6 +47,7 @@ func newBytes(size uint32) []byte { func freeBytes(b []byte) { size := uint32(cap(b)) + b = b[0:cap(b)] for i := numPools - 1; i >= 0; i-- { ps := poolSize[i] if size >= ps {