stream: fix memory leak when failing to insert segment

As introduced by commit f848e34bcc

DoInsertSegment can now return `-EINVAL` and there was no
generic handling of error values to return the tcp segment
to its pool.

Ticket: #5777
pull/8360/head
Philippe Antoine 4 years ago committed by Victor Julien
parent e15c9451f2
commit fff4475d91

@ -703,6 +703,9 @@ int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_
}
#endif
}
} else {
// EINVAL
StreamTcpSegmentReturntoPool(seg);
}
SCReturnInt(0);

Loading…
Cancel
Save