diff options
author | Connor Abbott <cwabbott0@gmail.com> | 2015-11-14 20:24:31 -0500 |
---|---|---|
committer | Connor Abbott <cwabbott0@gmail.com> | 2016-02-02 14:42:40 -0500 |
commit | 19db71807f9ad9af8cc994705a18e9dd06f72b5d (patch) | |
tree | 52e613e664dee5d1f08d2620a4888959616707fb /src/util | |
parent | 8fc2f652a29c7c307b9a076bbda4a5fce5e93361 (diff) |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 3247593c1f..3ec65afd4b 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; |