From: Victor Julien Date: Tue, 3 Apr 2018 10:10:46 +0000 (+0200) Subject: mpm/hs: fix minor coverity warning X-Git-Tag: suricata-4.0.5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=186391423eb3b7cb0ab50c9e9625c6b6d307d90a;p=thirdparty%2Fsuricata.git mpm/hs: fix minor coverity warning CID 1428797 (#1 of 1): Unchecked return value (CHECKED_RETURN) check_return: Calling HashTableAdd without checking return value (as is done elsewhere 5 out of 6 times). --- diff --git a/src/util-mpm-hs.c b/src/util-mpm-hs.c index a3a1179eb4..eca73f7cba 100644 --- a/src/util-mpm-hs.c +++ b/src/util-mpm-hs.c @@ -716,8 +716,10 @@ int SCHSPreparePatterns(MpmCtx *mpm_ctx) /* Cache this database globally for later. */ pd->ref_cnt = 1; - HashTableAdd(g_db_table, pd, 1); + int r = HashTableAdd(g_db_table, pd, 1); SCMutexUnlock(&g_db_table_mutex); + if (r < 0) + goto error; SCHSFreeCompileData(cd); return 0;