From 64f15d9992e08f5e7e2e483137320bec095a5063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveirinha?= Date: Tue, 29 Nov 2022 15:13:34 +0000 Subject: [PATCH] TUN-6981: We should close UDP socket if failed to connecto to edge --- connection/quic.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/connection/quic.go b/connection/quic.go index 645daf31..182cb881 100644 --- a/connection/quic.go +++ b/connection/quic.go @@ -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} }