]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix mem leak in b2g.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Sun, 29 Sep 2013 16:41:34 +0000 (22:11 +0530)
committerAnoop Saldanha <anoopsaldanha@gmail.com>
Sun, 29 Sep 2013 17:43:11 +0000 (23:13 +0530)
src/util-mpm-b2g.c

index f262672bfe0c5a4de637573a5cf93e7e803c696c..2dc475ae8cfef1ae907368f282a46913087fc97a 100644 (file)
@@ -270,6 +270,12 @@ void B2gFreePattern(MpmCtx *mpm_ctx, B2gPattern *p) {
         mpm_ctx->memory_size -= p->len;
     }
 
+    if (p != NULL && p->original_pat != NULL) {
+        SCFree(p->original_pat);
+        mpm_ctx->memory_cnt--;
+        mpm_ctx->memory_size -= p->len;
+    }
+
     if (p) {
         SCFree(p);
         mpm_ctx->memory_cnt--;