mirror of https://github.com/Dreamacro/clash.git
Fix: windows process panic (#2791)
This commit is contained in:
parent
18c666a1ab
commit
355eb491ad
|
@ -46,7 +46,7 @@ func findPidByConnectionEndpoint(family uint32, protocol uint32, from netip.Addr
|
||||||
buf := pool.Get(8)
|
buf := pool.Get(8)
|
||||||
defer pool.Put(buf)
|
defer pool.Put(buf)
|
||||||
|
|
||||||
bufSize := len(buf)
|
bufSize := uint32(len(buf))
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
|
@ -82,7 +82,7 @@ loop:
|
||||||
break loop
|
break loop
|
||||||
case uintptr(windows.ERROR_INSUFFICIENT_BUFFER):
|
case uintptr(windows.ERROR_INSUFFICIENT_BUFFER):
|
||||||
pool.Put(buf)
|
pool.Put(buf)
|
||||||
buf = pool.Get(bufSize)
|
buf = pool.Get(int(bufSize))
|
||||||
|
|
||||||
continue loop
|
continue loop
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue