fix: avoid VLESS decryption cleanup panic (#3195)

This commit is contained in:
浅小沫 authored and GitHub committed 2026-09-10 07:22:33 +08:00
1 parent d5f57a5e29
commit 20bcda2d1a
1 file changed
+2 -2
+2 -2
View File
@@ -74,10 +74,10 @@ func New(config LC.VlessServer, lc C.InboundListenConfig, tunnel C.Tunnel, addit
return nil, err
}
if sl.decryption != nil {
decryption := sl.decryption
defer func() { // decryption must be closed to avoid the goroutine leak
if err != nil {
_ = sl.decryption.Close()
sl.decryption = nil
_ = decryption.Close()
}
}()
}