From 3dd2e08411790e2aac262fcb6dcef95986613678 Mon Sep 17 00:00:00 2001 From: arloor Date: Wed, 27 Dec 2023 11:31:53 +0800 Subject: [PATCH] Fix bufferPool defer statement --- internal/server/connectHandlerFunc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/connectHandlerFunc.go b/internal/server/connectHandlerFunc.go index 6fd9e77..2d1d45a 100644 --- a/internal/server/connectHandlerFunc.go +++ b/internal/server/connectHandlerFunc.go @@ -128,7 +128,7 @@ func dualStream(target net.Conn, clientReader io.ReadCloser, clientWriter io.Wri stream := func(w io.Writer, r io.Reader) error { // copy bytes from r to w buf := bufferPool.Get().([]byte) - defer bufferPool.Put(&buf) + defer bufferPool.Put(buf) buf = buf[0:cap(buf)] _, _err := flushingIoCopy(w, r, buf) if closeWriter, ok := w.(interface {