]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mpm/hs: fix minor coverity warning
authorVictor Julien <victor@inliniac.net>
Tue, 3 Apr 2018 10:10:46 +0000 (12:10 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 16 Jul 2018 11:30:50 +0000 (13:30 +0200)
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

index a3a1179eb40925dddead82b885250298265560b8..eca73f7cba98435cb3e64b0e87537adf181922ba 100644 (file)
@@ -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;