diff --git a/gfx/cairo/cairo/src/cairo-hash.c b/gfx/cairo/cairo/src/cairo-hash.c --- a/gfx/cairo/cairo/src/cairo-hash.c +++ b/gfx/cairo/cairo/src/cairo-hash.c @@ -244,17 +238,17 @@ _cairo_hash_table_lookup_internal (cairo step = 0; for (i = 0; i < table_size; ++i) { entry = &hash_table->entries[idx]; if (ENTRY_IS_FREE(*entry)) { - return entry; + return first_available ? first_available : entry; } else if (ENTRY_IS_DEAD(*entry)) { if (key_is_unique) { return entry; } else { if (! first_available) first_available = entry;