diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2012-06-05 21:10:33 +0200 |
---|---|---|
committer | Marcin Slusarz <marcin.slusarz@gmail.com> | 2012-06-08 21:00:40 +0200 |
commit | ea055e19c2757dfe97dd13c1deee2bfa177eae3f (patch) | |
tree | b3adad8c184caaf5f9878712df9928fe95d714e4 /src/glsl/ir_constant_expression.cpp | |
parent | ca9977d5c6f8e6ff8290bdf094d978487519d6f5 (diff) | |
download | external_mesa3d-ea055e19c2757dfe97dd13c1deee2bfa177eae3f.zip external_mesa3d-ea055e19c2757dfe97dd13c1deee2bfa177eae3f.tar.gz external_mesa3d-ea055e19c2757dfe97dd13c1deee2bfa177eae3f.tar.bz2 |
glsl: fix deref_hash memory leak in constant_expression_value
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r-- | src/glsl/ir_constant_expression.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp index 7a4d15f..38a1ed9 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); |