From 93810e0e9ff269774d1f6a6acc1a7f0524beed38 Mon Sep 17 00:00:00 2001 From: ersonp Date: Mon, 19 Jul 2021 19:17:11 +0530 Subject: [PATCH] Fix nil pointer exception --- pkg/transport/network/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/transport/network/client.go b/pkg/transport/network/client.go index a5edc85b69..b1e3d05328 100644 --- a/pkg/transport/network/client.go +++ b/pkg/transport/network/client.go @@ -158,6 +158,7 @@ func (c *genericClient) wrapConn(rawConn net.Conn, hs handshake.Handshake, initi conn, err := doHandshake(rawConn, hs, c.netType, c.log) if err != nil { onClose() + return nil, err } conn.freePort = onClose c.log.Infof("Sent handshake to %v, local addr %v, remote addr %v", rawConn.RemoteAddr(), conn.lAddr, conn.rAddr)