]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Clean up sm_array memory at SigFree
authorVictor Julien <victor@inliniac.net>
Mon, 8 Dec 2014 11:11:15 +0000 (12:11 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 15 Jan 2015 10:52:04 +0000 (11:52 +0100)
src/detect-parse.c

index 92501e016ea3f32d2b04c9497aadbd4a7676e6fe..a6e54937bfa911bd5669b274b15ce8fd3d0f42ac 100644 (file)
@@ -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);