From: Victor Julien Date: Thu, 9 Aug 2018 11:45:04 +0000 (+0200) Subject: detect: don't setup PMATCH if it will be unused X-Git-Tag: suricata-4.1.0-rc2~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28a0291d07d54e7d40b4453e25cc41ced8ff2b3b;p=thirdparty%2Fsuricata.git detect: don't setup PMATCH if it will be unused Safes a bit of memory and makes it easier to debug. --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 98004b9128..47b1d24dc4 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -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); }