From: Connor Abbott Date: Sun, 15 Nov 2015 01:24:31 +0000 (-0500) Subject: util/hash_table: don't compare deleted entries X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19db71807f9ad9af8cc994705a18e9dd06f72b5d;p=mesa.git 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 --- diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 3247593c1f6..3ec65afd4bb 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;