From 67be07bf153ece3897d2df9768288c5b94c3d437 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sat, 22 Oct 2011 18:25:51 +0530 Subject: [PATCH] fix threading issue in debug log. locked mutex isn't freed before returning. fixed --- src/alert-debuglog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alert-debuglog.c b/src/alert-debuglog.c index 45f6677f27..180cd98a41 100644 --- a/src/alert-debuglog.c +++ b/src/alert-debuglog.c @@ -286,6 +286,7 @@ TmEcode AlertDebugLogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq uint8_t flag; if ((! PKT_IS_TCP(p)) || p->flow == NULL || p->flow->protoctx == NULL) { + SCMutexUnlock(&aft->file_ctx->fp_mutex); return TM_ECODE_OK; } /* IDS mode reverse the data */ @@ -299,6 +300,7 @@ TmEcode AlertDebugLogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq AlertDebugPrintStreamSegmentCallback, (void *)aft); if (ret != 1) { + SCMutexUnlock(&aft->file_ctx->fp_mutex); return TM_ECODE_FAILED; } }