From 3854c304d865d54775593ab52a90b0d039f0ba08 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 295e2552fa..364ebc6b63 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; -- 2.47.2