Fix buffer not released in batchLoopDarwin

This commit is contained in:
世界 2026-04-07 20:34:55 +08:00
parent 1664d083fb
commit 31c44bc478
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 4 additions and 0 deletions

View file

@ -184,6 +184,7 @@ func (m *Mixed) batchLoopDarwin(darwinTUN DarwinTUN) {
for _, buffer := range buffers {
packetSize := buffer.Len()
if packetSize < header.IPv4MinimumSize {
buffer.Release()
continue
}
if m.processPacket(buffer.Bytes()) {
@ -197,6 +198,7 @@ func (m *Mixed) batchLoopDarwin(darwinTUN DarwinTUN) {
if err != nil {
m.logger.Trace(E.Cause(err, "batch write packet"))
}
buf.ReleaseMulti(writeBuffers)
}
}
}