TUN-6981: We should close UDP socket if failed to connecto to edge

This commit is contained in:
João Oliveirinha 2022-11-29 15:13:34 +00:00
parent e3d35570e6
commit 64f15d9992
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ func NewQUICConnection(
session, err := quic.Dial(udpConn, edgeAddr, edgeAddr.String(), tlsConfig, quicConfig)
if err != nil {
// close the udp server socket in case of error connecting to the edge
udpConn.Close()
return nil, &EdgeQuicDialError{Cause: err}
}