glsl: fix deref_hash memory leak in constant_expression_value
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 5 Jun 2012 19:10:33 +0000 (21:10 +0200)
committerMarcin Slusarz <marcin.slusarz@gmail.com>
Fri, 8 Jun 2012 19:00:40 +0000 (21:00 +0200)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_constant_expression.cpp

index 7a4d15f43fb52dfd70316a75f8b5d042c1a1639b..38a1ed96c45415744eadd6a3bdd4794147b3a699 100644 (file)
@@ -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);