hash: fix hash collision logic
* Compare entry->key with key even when there is just one
entry present in the list.
@@ -240,6 +240,10 @@ int flb_hash_get(struct flb_hash *ht, char *key, int key_len,
entry = mk_list_entry_first(&table->chains,
struct flb_hash_entry,
_head);
+
+ if (strcmp(entry->key, key) != 0) {
+ entry = NULL;
+ }
}
else {
/* Iterate entries */
