Skip to content

Commit

Permalink
Fix bufferPool defer statement
Browse files Browse the repository at this point in the history
  • Loading branch information
arloor committed Dec 27, 2023
1 parent c6f90c9 commit 3dd2e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/server/connectHandlerFunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3dd2e08

Please sign in to comment.