aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/hash.c')
-rw-r--r--mesalib/src/mesa/main/hash.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/hash.c b/mesalib/src/mesa/main/hash.c
index 23018e9da..674c29d65 100644
--- a/mesalib/src/mesa/main/hash.c
+++ b/mesalib/src/mesa/main/hash.c
@@ -115,10 +115,20 @@ _mesa_NewHashTable(void)
if (table) {
table->ht = _mesa_hash_table_create(NULL, uint_key_compare);
+ if (table->ht == NULL) {
+ free(table);
+ _mesa_error_no_memory(__func__);
+ return NULL;
+ }
+
_mesa_hash_table_set_deleted_key(table->ht, uint_key(DELETED_KEY_VALUE));
mtx_init(&table->Mutex, mtx_plain);
mtx_init(&table->WalkMutex, mtx_plain);
}
+ else {
+ _mesa_error_no_memory(__func__);
+ }
+
return table;
}