Skip to content

Commit

Permalink
fix: possibly using released buffer in tproxy (#1286)
Browse files Browse the repository at this point in the history
  • Loading branch information
5aaee9 authored and wwqgtxx committed May 21, 2024
1 parent 43bdc76 commit ac25061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion listener/tproxy/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ func listenLocalConn(rAddr, lAddr net.Addr, tunnel C.Tunnel) (*net.UDPConn, erro
buf := pool.Get(pool.UDPBufferSize)
br, err := lc.Read(buf)
if err != nil {
pool.Put(buf)
if errors.Is(err, net.ErrClosed) {
log.Debugln("TProxy local conn listener exit.. rAddr=%s lAddr=%s", rAddr.String(), lAddr.String())
pool.Put(buf)
return
}
}
Expand Down

0 comments on commit ac25061

Please sign in to comment.