stream: fix potential memory loss on error

Coverity 1139543.

If StreamTcpPseudoPacket would be called with len == 0, the packet
it acquired before checking the len value would be lost.
pull/730/head
Victor Julien 11 years ago
parent 1cce207c05
commit 3714925d2b

@ -5244,8 +5244,12 @@ Packet *StreamTcpPseudoSetup(Packet *parent, uint8_t *pkt, uint32_t len)
{
SCEnter();
if (len == 0) {
SCReturnPtr(NULL, "Packet");
}
Packet *p = PacketGetFromQueueOrAlloc();
if (p == NULL || len == 0) {
if (p == NULL) {
SCReturnPtr(NULL, "Packet");
}

Loading…
Cancel
Save