From 30d84ab20dc299777e0e4522351ca05af0be60bb Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 26 Oct 2011 15:48:26 +0200 Subject: [PATCH] Unlock flow in StreamTcpSegmentForEach if there is no TCP session. --- src/stream-tcp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 5f6835f41c..cf5c322620 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -4603,8 +4603,10 @@ int StreamTcpSegmentForEach(Packet *p, uint8_t flag, StreamSegmentCallback Callb SCMutexLock(&p->flow->m); ssn = (TcpSession *)p->flow->protoctx; - if (ssn == NULL) - return 1; + if (ssn == NULL) { + SCMutexUnlock(&p->flow->m); + return 0; + } if (flag & FLOW_PKT_TOSERVER) { stream = &(ssn->server);