From daea85e49115f35ecdb87be8f56c1b476cf3f72d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 2 Jun 2010 18:42:54 +0200 Subject: [PATCH] Lock detection state reset function properly. --- src/detect-engine-state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index 4844c32209..f5cca92f6a 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -135,6 +135,8 @@ void DetectEngineStateReset(DetectEngineState *state) { SCReturn; } + SCMutexLock(&state->m); + if (state->head != NULL) { DeStateStoreFree(state->head); } @@ -142,6 +144,7 @@ void DetectEngineStateReset(DetectEngineState *state) { state->tail = NULL; state->cnt = 0; + SCMutexUnlock(&state->m); SCReturn; }