From 6717c356e3d23dccbd837c85e37e51566e7a4f54 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 8 Dec 2014 12:11:15 +0100 Subject: [PATCH] Clean up sm_array memory at SigFree --- src/detect-parse.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/detect-parse.c b/src/detect-parse.c index 92501e016e..a6e54937bf 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -913,6 +913,17 @@ static void SigRefFree (Signature *s) SCReturn; } +static void SigMatchFreeArrays(Signature *s) +{ + if (s != NULL) { + int type; + for (type = 0; type < DETECT_SM_LIST_MAX; type++) { + if (s->sm_arrays[type] != NULL) + SCFree(s->sm_arrays[type]); + } + } +} + void SigFree(Signature *s) { if (s == NULL) @@ -933,6 +944,7 @@ void SigFree(Signature *s) sm = nsm; } } + SigMatchFreeArrays(s); DetectAddressHeadCleanup(&s->src); DetectAddressHeadCleanup(&s->dst);