Hi ----- Original Message ----- > Fix the leak of some ctx fields in error path. > > Signed-off-by: Li Qiang <liq...@gmail.com> > --- > src/gallium/auxiliary/tgsi/tgsi_sanity.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c > b/src/gallium/auxiliary/tgsi/tgsi_sanity.c > index f867925..c3d5094 100644 > --- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c > +++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c > @@ -580,8 +580,12 @@ tgsi_sanity_check( > ctx.implied_array_size = 0; > ctx.print = debug_get_option_print_sanity(); > > - if (!tgsi_iterate_shader( tokens, &ctx.iter )) > + if (!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); > return FALSE; > + }
Or just set ctx.errors = 1 and let it go through. > > regs_hash_destroy(ctx.regs_decl); > regs_hash_destroy(ctx.regs_used); > -- > 2.7.4 > > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev