fix(netxlite/quic): close udp conn after failed handshake (#533)

Closes https://github.com/ooni/probe/issues/1794
This commit is contained in:
Simone Basso 2021-09-30 18:00:38 +02:00 committed by GitHub
parent 86018ecb82
commit 762fb27c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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