diff --git a/net/socks5/socks5.go b/net/socks5/socks5.go index 12331f3fd..a5dfee820 100644 --- a/net/socks5/socks5.go +++ b/net/socks5/socks5.go @@ -112,11 +112,11 @@ func (s *Server) Serve(l net.Listener) error { return err } go func() { + defer c.Close() conn := &Conn{clientConn: c, srv: s} err := conn.Run() if err != nil { s.logf("client connection failed: %v", err) - conn.clientConn.Close() } }() }