detect: don't setup PMATCH if it will be unused

Safes a bit of memory and makes it easier to debug.
pull/3451/head
Victor Julien 7 years ago
parent 6694593cc0
commit 28a0291d07

@ -1849,6 +1849,9 @@ static int SigMatchPrepare(DetectEngineCtx *de_ctx)
/* built-ins */
int type;
for (type = 0; type < DETECT_SM_LIST_MAX; type++) {
/* skip PMATCH if it is used in a stream 'app engine' instead */
if (type == DETECT_SM_LIST_PMATCH && (s->init_data->init_flags & SIG_FLAG_INIT_STATE_MATCH))
continue;
SigMatch *sm = s->init_data->smlists[type];
s->sm_arrays[type] = SigMatchList2DataArray(sm);
}

Loading…
Cancel
Save