sizeof(SC_AC_BS_STATE_TYPE_U32) * 256);
}
+ if (ctx->output_table != NULL) {
+ uint32_t state_count;
+ for (state_count = 0; state_count < ctx->state_count; state_count++) {
+ if (ctx->output_table[state_count].pids != NULL) {
+ SCFree(ctx->output_table[state_count].pids);
+ }
+ }
+ SCFree(ctx->output_table);
+ }
+
+ if (ctx->pid_pat_list != NULL) {
+ int i;
+ for (i = 0; i < (ctx->max_pat_id + 1); i++) {
+ if (ctx->pid_pat_list[i].cs != NULL)
+ SCFree(ctx->pid_pat_list[i].cs);
+ }
+ SCFree(ctx->pid_pat_list);
+ }
+
+ if (ctx->state_table_mod != NULL) {
+ SCFree(ctx->state_table_mod);
+ ctx->state_table_mod = NULL;
+ }
+
+ if (ctx->state_table_mod_pointers != NULL) {
+ SCFree(ctx->state_table_mod_pointers);
+ ctx->state_table_mod_pointers = NULL;
+ }
+
SCFree(mpm_ctx->ctx);
mpm_ctx->memory_cnt--;
mpm_ctx->memory_size -= sizeof(SCACBSCtx);
mpm_ctx->memory_size -= ctx->state_count * sizeof(uint8_t *);
}
+ if (ctx->output_table != NULL) {
+ int32_t state_count;
+ for (state_count = 0; state_count < ctx->state_count; state_count++) {
+ if (ctx->output_table[state_count].pids != NULL) {
+ SCFree(ctx->output_table[state_count].pids);
+ }
+ }
+ SCFree(ctx->output_table);
+ }
+
+ if (ctx->pid_pat_list != NULL) {
+ int i;
+ for (i = 0; i < (ctx->max_pat_id + 1); i++) {
+ if (ctx->pid_pat_list[i].cs != NULL)
+ SCFree(ctx->pid_pat_list[i].cs);
+ }
+ SCFree(ctx->pid_pat_list);
+ }
+
SCFree(mpm_ctx->ctx);
mpm_ctx->memory_cnt--;
mpm_ctx->memory_size -= sizeof(SCACGfbsCtx);
return;
if (!MpmFactoryIsMpmCtxAvailable(de_ctx, mpm_ctx)) {
- mpm_table[mpm_ctx->mpm_type].DestroyCtx(mpm_ctx);
+ if (mpm_ctx->mpm_type != MPM_NOTSET)
+ mpm_table[mpm_ctx->mpm_type].DestroyCtx(mpm_ctx);
SCFree(mpm_ctx);
}
if (items[i].name != NULL)
SCFree(items[i].name);
if (items[i].mpm_ctx_ts != NULL) {
- mpm_table[items[i].mpm_ctx_ts->mpm_type].DestroyCtx(items[i].mpm_ctx_ts);
+ if (items[i].mpm_ctx_ts->mpm_type != MPM_NOTSET)
+ 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) {
- mpm_table[items[i].mpm_ctx_tc->mpm_type].DestroyCtx(items[i].mpm_ctx_tc);
+ if (items[i].mpm_ctx_tc->mpm_type != MPM_NOTSET)
+ mpm_table[items[i].mpm_ctx_tc->mpm_type].DestroyCtx(items[i].mpm_ctx_tc);
SCFree(items[i].mpm_ctx_tc);
}
}