Mesa (staging/19.1): nir: fix memleak in error path
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Sep 6 10:41:21 UTC 2019
Module: Mesa
Branch: staging/19.1
Commit: 29159cbf2149cd9f96c385df4de0cde9e83a0215
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=29159cbf2149cd9f96c385df4de0cde9e83a0215
Author: Eric Engestrom <eric.engestrom at intel.com>
Date: Mon Aug 26 15:33:31 2019 +0100
nir: fix memleak in error path
Fixes: 2cf59861a8128a91bfdd ("nir: Add partial redundancy elimination for compares")
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit 7659c6197f08587f57f101a88a7e477337ce363c)
---
src/compiler/nir/nir_opt_comparison_pre.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_opt_comparison_pre.c b/src/compiler/nir/nir_opt_comparison_pre.c
index a7a227ce371..9a7688ad41e 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);
More information about the mesa-commit
mailing list