From 186391423eb3b7cb0ab50c9e9625c6b6d307d90a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 3 Apr 2018 12:10:46 +0200 Subject: [PATCH] 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). --- src/util-mpm-hs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util-mpm-hs.c b/src/util-mpm-hs.c index a3a1179eb409..eca73f7cba98 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;