From: Eric Engestrom Date: Mon, 26 Aug 2019 14:33:31 +0000 (+0100) Subject: nir: fix memleak in error path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7659c6197f08587f57f101a88a7e477337ce363c;p=mesa.git nir: fix memleak in error path Fixes: 2cf59861a8128a91bfdd ("nir: Add partial redundancy elimination for compares") Signed-off-by: Eric Engestrom Reviewed-by: Timothy Arceri Reviewed-by: Ian Romanick --- diff --git a/src/compiler/nir/nir_opt_comparison_pre.c b/src/compiler/nir/nir_opt_comparison_pre.c index 33295e5eea6..a74dfa8939a 100644 --- a/src/compiler/nir/nir_opt_comparison_pre.c +++ b/src/compiler/nir/nir_opt_comparison_pre.c @@ -107,8 +107,10 @@ push_block(struct block_queue *bq) if (!u_vector_init(&bi->instructions, sizeof(nir_alu_instr *), - 8 * sizeof(nir_alu_instr *))) + 8 * sizeof(nir_alu_instr *))) { + free(bi); return NULL; + } exec_list_push_tail(&bq->blocks, &bi->node);