diff options
author | Eric Engestrom <[email protected]> | 2019-08-26 15:33:31 +0100 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-09-04 16:15:36 -0700 |
commit | ffa1f33ec0fc2153aca1bb1d0e85d5d11e6c892b (patch) | |
tree | e76cd7f7453353503baa385ece4499d99d45cb10 | |
parent | 0bbf6eab521e42d92682b8cac21d0f9514562346 (diff) |
nir: fix memleak in error path
Fixes: 2cf59861a8128a91bfdd ("nir: Add partial redundancy elimination for compares")
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
(cherry picked from commit 7659c6197f08587f57f101a88a7e477337ce363c)
-rw-r--r-- | src/compiler/nir/nir_opt_comparison_pre.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |