more mpm engine mem cleanup

remotes/origin/master
Anoop Saldanha 13 years ago committed by Victor Julien
parent 0eaf0b0129
commit c1cc9188fd

@ -229,8 +229,10 @@ void MpmFactoryReClaimMpmCtx(DetectEngineCtx *de_ctx, MpmCtx *mpm_ctx)
if (mpm_ctx == NULL) if (mpm_ctx == NULL)
return; 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); SCFree(mpm_ctx);
}
return; return;
} }
@ -245,11 +247,15 @@ void MpmFactoryDeRegisterAllMpmCtxProfiles(DetectEngineCtx *de_ctx)
for (i = 0; i < de_ctx->mpm_ctx_factory_container->no_of_items; i++) { for (i = 0; i < de_ctx->mpm_ctx_factory_container->no_of_items; i++) {
if (items[i].name != NULL) if (items[i].name != NULL)
SCFree(items[i].name); 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); 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(items[i].mpm_ctx_tc);
} }
}
SCFree(de_ctx->mpm_ctx_factory_container->items); SCFree(de_ctx->mpm_ctx_factory_container->items);
SCFree(de_ctx->mpm_ctx_factory_container); SCFree(de_ctx->mpm_ctx_factory_container);

Loading…
Cancel
Save