diff --git a/adapter/outbound/util.go b/adapter/outbound/util.go index f32aae29..68d6b355 100644 --- a/adapter/outbound/util.go +++ b/adapter/outbound/util.go @@ -126,7 +126,7 @@ func resolveUDPAddrWithPrefer(ctx context.Context, network, address string, pref if !ip.IsValid() && fallback.IsValid() { ip = fallback } - + if err != nil { return nil, err } @@ -134,7 +134,7 @@ func resolveUDPAddrWithPrefer(ctx context.Context, network, address string, pref } func safeConnClose(c net.Conn, err error) { - if err != nil { + if err != nil && c != nil { _ = c.Close() } }