From: Anoop Saldanha Date: Sun, 29 Sep 2013 16:41:34 +0000 (+0530) Subject: Fix mem leak in b2g. X-Git-Tag: suricata-2.0beta2~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc826140256290375e3a455563cff9d6d65d443b;p=thirdparty%2Fsuricata.git Fix mem leak in b2g. --- diff --git a/src/util-mpm-b2g.c b/src/util-mpm-b2g.c index f262672bfe..2dc475ae8c 100644 --- a/src/util-mpm-b2g.c +++ b/src/util-mpm-b2g.c @@ -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--;