From d4fcc97a3f46f4b2ece9b510b9dd6aab1a97687b Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Fri, 26 May 2023 17:30:37 -0700 Subject: [PATCH] compiler/types: Use ralloc for the key in array_types Reviewed-by: Kenneth Graunke Part-of: --- src/compiler/glsl_types.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index a7356e2c7e1..2e23b2b4dd2 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -482,10 +482,6 @@ static void hash_free_type_function(struct hash_entry *entry) { glsl_type *type = (glsl_type *) entry->data; - - if (type->is_array()) - free((void*)entry->key); - delete type; } @@ -1228,7 +1224,7 @@ glsl_type::get_array_instance(const glsl_type *element, const glsl_type *t = new glsl_type(element, array_size, explicit_stride); entry = _mesa_hash_table_insert_pre_hashed(array_types, key_hash, - strdup(key), + ralloc_strdup(t->mem_ctx, key), (void *) t); }