1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-22 05:29:14 -04:00

A temporary testing fix for the buffer corruption issue (#3331)

This commit is contained in:
Xiaokang Wang (Shelikhoo)
2025-02-27 14:32:04 +00:00
committed by GitHub
parent 4144c87fc1
commit 561f31245d
2 changed files with 7 additions and 2 deletions

View File

@@ -250,7 +250,10 @@ func (d *DefaultDispatcher) Dispatch(ctx context.Context, destination net.Destin
func sniffer(ctx context.Context, cReader *cachedReader, metadataOnly bool, network net.Network) (SniffResult, error) {
payload := buf.New()
defer payload.Release()
defer func() {
payload.Release()
}()
sniffer := NewSniffer(ctx)

View File

@@ -52,7 +52,9 @@ func SniffQUIC(b []byte) (*SniffHeader, error) {
// Crypto data separated across packets
cryptoLen := 0
cryptoData := bytespool.Alloc(int32(len(b)))
defer bytespool.Free(cryptoData)
defer func() {
bytespool.Free(cryptoData)
}()
cache := buf.New()
defer cache.Release()