diff --git a/src/util-mpm.c b/src/util-mpm.c index 66fa4840c9..e31a20d10a 100644 --- a/src/util-mpm.c +++ b/src/util-mpm.c @@ -91,6 +91,7 @@ MpmMatchCleanup(MpmThreadCtx *thread_ctx) { MpmMatch *m = thread_ctx->qlist; while (m != NULL) { + BUG_ON(m == m->qnext); nxt = m->qnext; /* clear the bucket */ @@ -111,7 +112,6 @@ MpmMatchCleanup(MpmThreadCtx *thread_ctx) { m = nxt; } - } /** \brief allocate a match @@ -195,6 +195,8 @@ MpmMatchAppend(MpmThreadCtx *thread_ctx, PatternMatcherQueue *pmq, MpmEndMatch * thread_ctx->qlist = m; } + BUG_ON(m == m->qnext); + if (pmq != NULL) { /* make sure we only append a sig with a matching pattern once, * so we won't inspect it more than once. For this we keep a