From 762fb27c0bb3c17124bf6ce0cacadd68542aa486 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Thu, 30 Sep 2021 18:00:38 +0200 Subject: [PATCH] fix(netxlite/quic): close udp conn after failed handshake (#533) Closes https://github.com/ooni/probe/issues/1794 --- internal/netxlite/quic.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/netxlite/quic.go b/internal/netxlite/quic.go index 25a3670..d0c1f66 100644 --- a/internal/netxlite/quic.go +++ b/internal/netxlite/quic.go @@ -154,6 +154,7 @@ func (d *quicDialerQUICGo) DialContext(ctx context.Context, network string, sess, err := d.dialEarlyContext( ctx, pconn, udpAddr, address, tlsConfig, quicConfig) if err != nil { + pconn.Close() // we own it on failure return nil, err } return &quicSessionOwnsConn{EarlySession: sess, conn: pconn}, nil