diff --git a/src/detect-parse.c b/src/detect-parse.c index b49ee57fcf..a896e8bc2a 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1060,9 +1060,9 @@ void SigFree(Signature *s) int i; for (i = 0; i < DETECT_SM_LIST_MAX; i++) { - SigMatch *sm = s->sm_lists[i], *nsm; + SigMatch *sm = s->sm_lists[i]; while (sm != NULL) { - nsm = sm->next; + SigMatch *nsm = sm->next; SigMatchFree(sm); sm = nsm; } @@ -1097,6 +1097,12 @@ void SigFree(Signature *s) DetectEngineAppInspectionEngine *ie = s->app_inspect; while (ie) { DetectEngineAppInspectionEngine *next = ie->next; + SigMatch *sm = ie->sm; + while (sm != NULL) { + SigMatch *nsm = sm->next; + SigMatchFree(sm); + sm = nsm; + } SCFree(ie); ie = next; }