Free all sig match structs when freeing a signature.

remotes/origin/HEAD
Victor Julien 13 years ago
parent f4c7bd4e5b
commit ab421978f0

@ -835,39 +835,14 @@ void SigFree(Signature *s) {
if (s->CidrSrc != NULL) if (s->CidrSrc != NULL)
IPOnlyCIDRListFree(s->CidrSrc); IPOnlyCIDRListFree(s->CidrSrc);
SigMatch *sm = s->sm_lists[DETECT_SM_LIST_MATCH], *nsm; int i;
while (sm != NULL) { for (i = 0; i < DETECT_SM_LIST_MAX; i++) {
nsm = sm->next; SigMatch *sm = s->sm_lists[i], *nsm;
SigMatchFree(sm); while (sm != NULL) {
sm = nsm; nsm = sm->next;
} SigMatchFree(sm);
sm = nsm;
sm = s->sm_lists[DETECT_SM_LIST_PMATCH]; }
while (sm != NULL) {
nsm = sm->next;
SigMatchFree(sm);
sm = nsm;
}
sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
while (sm != NULL) {
nsm = sm->next;
SigMatchFree(sm);
sm = nsm;
}
sm = s->sm_lists[DETECT_SM_LIST_AMATCH];
while (sm != NULL) {
nsm = sm->next;
SigMatchFree(sm);
sm = nsm;
}
sm = s->sm_lists[DETECT_SM_LIST_TMATCH];
while (sm != NULL) {
nsm = sm->next;
SigMatchFree(sm);
sm = nsm;
} }
DetectAddressHeadCleanup(&s->src); DetectAddressHeadCleanup(&s->src);

Loading…
Cancel
Save