From c1cc9188fdd8025c5bad86bf18a996908f32fb37 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Tue, 3 Jul 2012 11:00:21 +0530 Subject: [PATCH] more mpm engine mem cleanup --- src/util-mpm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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); -- 2.47.2