aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-02-10 14:03:51 +1000
committerEmil Velikov <[email protected]>2017-02-23 19:34:58 +0000
commitbd25bc66bde20c297e8bae373f371eb1a372c3a4 (patch)
treefef59230a07b79bed571b16344d75183874a3ef1 /src
parent4d40f721d1daaaafebc4b6ef997d9ad45fe9bd5c (diff)
tgsi: fix memory leak in tgsi sanity check
This just fixes this without repeating the code. Reported-by: Li Qiang Cc: "17.0" <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 69fc7a2c828adbb454072d386a26b568e56dd886)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_sanity.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
index f867925ef58..239a2c93835 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
@@ -559,6 +559,7 @@ tgsi_sanity_check(
const struct tgsi_token *tokens )
{
struct sanity_check_ctx ctx;
+ boolean retval;
ctx.iter.prolog = prolog;
ctx.iter.iterate_instruction = iter_instruction;
@@ -580,11 +581,12 @@ tgsi_sanity_check(
ctx.implied_array_size = 0;
ctx.print = debug_get_option_print_sanity();
- if (!tgsi_iterate_shader( tokens, &ctx.iter ))
- return FALSE;
-
+ retval = tgsi_iterate_shader( tokens, &ctx.iter );
regs_hash_destroy(ctx.regs_decl);
regs_hash_destroy(ctx.regs_used);
regs_hash_destroy(ctx.regs_ind_used);
+ if (retval == FALSE)
+ return FALSE;
+
return ctx.errors == 0;
}