From afe01ef103a52e842adf7560662aa076458e0e16 Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Sun, 13 Jul 2025 00:58:30 +0800 Subject: [PATCH] close Transport when DialAddr fails (#5259) Close the transport after dial fails to avoid memory leaks. Same logic as DialAddrEarly. Signed-off-by: Coia Prant --- client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client.go b/client.go index 5386e5980..63132f2de 100644 --- a/client.go +++ b/client.go @@ -31,6 +31,7 @@ func DialAddr(ctx context.Context, addr string, tlsConf *tls.Config, conf *Confi } conn, err := tr.dial(ctx, udpAddr, addr, tlsConf, conf, false) if err != nil { + tr.Close() return nil, err } return conn, nil