diff --git a/stream.go b/stream.go index d60e3e3..c8a518a 100644 --- a/stream.go +++ b/stream.go @@ -103,8 +103,8 @@ func (s *Stream) WriteTo(w io.Writer) (n int64, err error) { if buf != nil { nw, ew := w.Write(buf) - defaultAllocator.Put(buf) s.sess.returnTokens(len(buf)) + defaultAllocator.Put(buf) if nw > 0 { n += int64(nw) }