From: Marcin Slusarz Date: Tue, 5 Jun 2012 19:10:33 +0000 (+0200) Subject: glsl: fix deref_hash memory leak in constant_expression_value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea055e19c2757dfe97dd13c1deee2bfa177eae3f;p=mesa.git glsl: fix deref_hash memory leak in constant_expression_value Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 7a4d15f43fb..38a1ed96c45 100644 --- a/src/glsl/ir_constant_expression.cpp +++ b/src/glsl/ir_constant_expression.cpp @@ -1322,8 +1322,11 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s foreach_list(n, actual_parameters) { ir_constant *constant = ((ir_rvalue *) n)->constant_expression_value(variable_context); - if (constant == NULL) - return NULL; + if (constant == NULL) { + hash_table_dtor(deref_hash); + return NULL; + } + ir_variable *var = (ir_variable *)parameter_info; hash_table_insert(deref_hash, constant, var);