fix: close connection after error handling in doq

This commit is contained in:
wwqgtxx committed 2026-09-14 13:49:12 +08:00
1 parent 7d7532d49f
commit 0436650753
1 file changed
+2
+2
View File
@@ -339,6 +339,7 @@ func (doq *dnsOverQUIC) openConnection(ctx context.Context) (quicConn *quic.Conn
host, _, err := net.SplitHostPort(doq.addr)
if err != nil {
_ = packetConn.Close()
return nil, err
}
@@ -354,6 +355,7 @@ func (doq *dnsOverQUIC) openConnection(ctx context.Context) (quicConn *quic.Conn
NameCertVerify: doq.nameCertVerify,
})
if err != nil {
_ = packetConn.Close()
return nil, err
}