radv/rt: fix a memory leak with hash tables

Found with ASAN.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41991>
This commit is contained in:
Samuel Pitoiset 2026-06-03 11:21:52 +02:00 committed by Marge Bot
parent b6661df5f0
commit e247bdae0f
2 changed files with 4 additions and 0 deletions

View file

@ -278,6 +278,8 @@ radv_build_recursive_case(nir_builder *b, nir_def *idx, struct radv_ray_tracing_
nir_inline_function_impl(b, nir_shader_get_entrypoint(shader), NULL, var_remap);
nir_pop_if(b, NULL);
ralloc_free(shader);
_mesa_hash_table_destroy(var_remap, NULL);
}
struct lower_rt_instruction_monolithic_state {

View file

@ -400,6 +400,8 @@ insert_inlined_shader(nir_builder *b, struct traversal_inlining_params *params,
nir_push_if(b, nir_ieq_imm(b, idx, call_idx));
nir_inline_function_impl(b, nir_shader_get_entrypoint(shader), NULL, var_remap);
nir_pop_if(b, NULL);
_mesa_hash_table_destroy(var_remap, NULL);
}
static nir_function_impl *