summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2015-11-14 20:24:31 -0500
committerConnor Abbott <cwabbott0@gmail.com>2016-02-02 14:42:40 -0500
commit19db71807f9ad9af8cc994705a18e9dd06f72b5d (patch)
tree52e613e664dee5d1f08d2620a4888959616707fb /src/util
parent8fc2f652a29c7c307b9a076bbda4a5fce5e93361 (diff)
downloadexternal_mesa3d-19db71807f9ad9af8cc994705a18e9dd06f72b5d.zip
external_mesa3d-19db71807f9ad9af8cc994705a18e9dd06f72b5d.tar.gz
external_mesa3d-19db71807f9ad9af8cc994705a18e9dd06f72b5d.tar.bz2
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 <timothy.arceri@collabora.com> Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/hash_table.c3
1 files changed, 2 insertions, 1 deletions
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;