Skip to content

Commit

Permalink
[v1.39.x_conn_leak] server: fix leaked net.Conn (grpc#4633)
Browse files Browse the repository at this point in the history
This happens when NewServerTransport() returns nil, nil. The rawConn is
closed when the transport is closed, which will never happen in this
case (since the returned transport is nil).
  • Loading branch information
menghanl committed Aug 3, 2021
1 parent 2e0b66b commit 2151f1d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server.go
Expand Up @@ -863,6 +863,7 @@ func (s *Server) handleRawConn(lisAddr string, rawConn net.Conn) {
// Finish handshaking (HTTP2)
st := s.newHTTP2Transport(conn, authInfo)
if st == nil {
conn.Close()
return
}

Expand Down

0 comments on commit 2151f1d

Please sign in to comment.