From: Victor Julien Date: Thu, 25 Oct 2018 09:55:05 +0000 (+0200) Subject: mpm: fix minor scan-build warning X-Git-Tag: suricata-4.0.6~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5669c177526ac6735ed42512377aa33da1ff59f;p=thirdparty%2Fsuricata.git mpm: fix minor scan-build warning --- diff --git a/src/util-mpm.c b/src/util-mpm.c index 92fdedd52e..2610388a85 100644 --- a/src/util-mpm.c +++ b/src/util-mpm.c @@ -600,7 +600,7 @@ static inline int MpmInitHashAdd(MpmCtx *ctx, MpmPattern *p) uint32_t hash = MpmInitHash(p); if (ctx->init_hash == NULL) { - return 0; + return -1; } if (ctx->init_hash[hash] == NULL) { @@ -699,7 +699,8 @@ int MpmAddPattern(MpmCtx *mpm_ctx, uint8_t *pat, uint16_t patlen, } /* put in the pattern hash */ - MpmInitHashAdd(mpm_ctx, p); + if (MpmInitHashAdd(mpm_ctx, p) != 0) + goto error; mpm_ctx->pattern_cnt++;