From 19db71807f9ad9af8cc994705a18e9dd06f72b5d Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Sat, 14 Nov 2015 20:24:31 -0500 Subject: util/hash_table: don't compare deleted entries The equivalent of the last patch for the hash table. I'm not aware of any issues this fixes. v2: - use entry_is_deleted (Timothy) Reviewed-by: Timothy Arceri Signed-off-by: Connor Abbott --- src/util/hash_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 3247593..3ec65af 100644 --- a/src/util/hash_table.c +++ b/src/util/hash_table.c @@ -300,7 +300,8 @@ hash_table_insert(struct hash_table *ht, uint32_t hash, * required to avoid memory leaks, perform a search * before inserting. */ - if (entry->hash == hash && + if (!entry_is_deleted(ht, entry) && + entry->hash == hash && ht->key_equals_function(key, entry->key)) { entry->key = key; entry->data = data; -- cgit v1.1