From 5fa5f3fbb9fb573adc6d94569b1d2d39b6d5caf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Wed, 27 Aug 2025 17:33:09 +0800 Subject: [PATCH] WireGuard outbound: Fix close closed (#5054) Fixes https://github.com/XTLS/Xray-core/issues/5053 --- proxy/wireguard/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/wireguard/client.go b/proxy/wireguard/client.go index 345581c7..9de24360 100644 --- a/proxy/wireguard/client.go +++ b/proxy/wireguard/client.go @@ -129,7 +129,8 @@ func (h *Handler) processWireGuard(ctx context.Context, dialer internet.Dialer) } defer func() { if err != nil { - _ = h.bind.Close() + h.bind.Close() + h.bind = nil } }()