]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Hash table: free bucker in case of insertion error
authorPierre Chifflier <chifflier@wzdftpd.net>
Mon, 17 Mar 2014 17:59:35 +0000 (18:59 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Jan 2018 09:32:16 +0000 (10:32 +0100)
This fixes a warning raised by cppcheck.

src/util-hash.c

index b9c9986f94cec1f5b94f65d173f8ebf152768173..98765f5c3dd92fe4f63aac1c97526d952f80fc99 100644 (file)
@@ -144,6 +144,8 @@ int HashTableAdd(HashTable *ht, void *data, uint16_t datalen)
     return 0;
 
 error:
+    if (hb != NULL)
+        SCFree(hb);
     return -1;
 }