aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/program')
-rw-r--r--mesalib/src/mesa/program/prog_hash_table.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mesalib/src/mesa/program/prog_hash_table.c b/mesalib/src/mesa/program/prog_hash_table.c
index f45ed46af..2445d8434 100644
--- a/mesalib/src/mesa/program/prog_hash_table.c
+++ b/mesalib/src/mesa/program/prog_hash_table.c
@@ -142,6 +142,10 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key)
struct hash_node *node;
node = calloc(1, sizeof(*node));
+ if (node == NULL) {
+ _mesa_error_no_memory(__func__);
+ return;
+ }
node->data = data;
node->key = key;
@@ -167,6 +171,10 @@ hash_table_replace(struct hash_table *ht, void *data, const void *key)
}
hn = calloc(1, sizeof(*hn));
+ if (hn == NULL) {
+ _mesa_error_no_memory(__func__);
+ return false;
+ }
hn->data = data;
hn->key = key;