1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

release used buffer in packet connection wrapper

This commit is contained in:
Shelikhoo 2021-12-27 22:21:40 +00:00 committed by Xiaokang Wang (Shelikhoo)
parent 35db419556
commit ddf25beec1

View File

@ -132,6 +132,7 @@ func (pc *packetConnWrapper) Read(p []byte) (n int, err error) {
} }
result := AttachAddressToPacket(recbuf.Bytes()[0:n], addr) result := AttachAddressToPacket(recbuf.Bytes()[0:n], addr)
n = copy(p, result) n = copy(p, result)
recbuf.Release()
return n, nil return n, nil
} }