diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 301b360bf5..dd5314fffc 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -619,8 +619,6 @@ uint16_t PatternMatchDefaultMatcher(void) /* Get the mpm algo defined in config file by the user */ if ((ConfGet("mpm-algo", &mpm_algo)) == 1) { - uint16_t u; - if (mpm_algo != NULL) { #if __BYTE_ORDER == __BIG_ENDIAN if (strcmp(mpm_algo, "ac-ks") == 0) { @@ -631,7 +629,7 @@ uint16_t PatternMatchDefaultMatcher(void) if (strcmp("auto", mpm_algo) == 0) { goto done; } - for (u = 0; u < MPM_TABLE_SIZE; u++) { + for (uint16_t u = 0; u < MPM_TABLE_SIZE; u++) { if (mpm_table[u].name == NULL) continue; @@ -643,14 +641,13 @@ uint16_t PatternMatchDefaultMatcher(void) } #ifndef BUILD_HYPERSCAN - if ((mpm_algo != NULL) && (strcmp(mpm_algo, "hs") == 0)) { - FatalError(SC_ERR_INVALID_VALUE, "Hyperscan (hs) support for mpm-algo is " - "not compiled into Suricata."); - } + if ((strcmp(mpm_algo, "hs") == 0)) { + FatalError(SC_ERR_INVALID_VALUE, "Hyperscan (hs) support for mpm-algo is " + "not compiled into Suricata."); + } #endif - SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "Invalid mpm algo supplied " + FatalError(SC_ERR_INVALID_YAML_CONF_ENTRY, "Invalid mpm algo supplied " "in the yaml conf file: \"%s\"", mpm_algo); - exit(EXIT_FAILURE); } done: