From: Anoop Saldanha Date: Tue, 3 Jul 2012 05:30:21 +0000 (+0530) Subject: more mpm engine mem cleanup X-Git-Tag: suricata-1.3~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1cc9188fdd8025c5bad86bf18a996908f32fb37;p=thirdparty%2Fsuricata.git more mpm engine mem cleanup --- diff --git a/src/util-mpm.c b/src/util-mpm.c index 8da0bc702e..785915120e 100644 --- a/src/util-mpm.c +++ b/src/util-mpm.c @@ -229,8 +229,10 @@ void MpmFactoryReClaimMpmCtx(DetectEngineCtx *de_ctx, MpmCtx *mpm_ctx) if (mpm_ctx == NULL) return; - if (!MpmFactoryIsMpmCtxAvailable(de_ctx, mpm_ctx)) + if (!MpmFactoryIsMpmCtxAvailable(de_ctx, mpm_ctx)) { + mpm_table[mpm_ctx->mpm_type].DestroyCtx(mpm_ctx); SCFree(mpm_ctx); + } return; } @@ -245,10 +247,14 @@ void MpmFactoryDeRegisterAllMpmCtxProfiles(DetectEngineCtx *de_ctx) for (i = 0; i < de_ctx->mpm_ctx_factory_container->no_of_items; i++) { if (items[i].name != NULL) SCFree(items[i].name); - if (items[i].mpm_ctx_ts != NULL) + if (items[i].mpm_ctx_ts != NULL) { + mpm_table[items[i].mpm_ctx_ts->mpm_type].DestroyCtx(items[i].mpm_ctx_ts); SCFree(items[i].mpm_ctx_ts); - if (items[i].mpm_ctx_tc != NULL) + } + if (items[i].mpm_ctx_tc != NULL) { + mpm_table[items[i].mpm_ctx_tc->mpm_type].DestroyCtx(items[i].mpm_ctx_tc); SCFree(items[i].mpm_ctx_tc); + } } SCFree(de_ctx->mpm_ctx_factory_container->items);