From dcc6288a137fc8f1eed1cb1e7431e2f8640ac972 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 5 Jul 2023 10:40:34 +0200 Subject: [PATCH] broadcom/compiler: free defin and defout arrays if they already exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just like we do for everything else here, since we are going to realloc them again right below. Notice this is not exactly a memory leak, since all these arrays are allocated with ralloc using v3d_compile as context, so all allocations will be eventually freed when the context is destroyed. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/compiler/vir_live_variables.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/broadcom/compiler/vir_live_variables.c b/src/broadcom/compiler/vir_live_variables.c index 2fd6430a0f4..575b0481dc8 100644 --- a/src/broadcom/compiler/vir_live_variables.c +++ b/src/broadcom/compiler/vir_live_variables.c @@ -306,6 +306,8 @@ vir_calculate_live_intervals(struct v3d_compile *c) vir_for_each_block(block, c) { ralloc_free(block->def); + ralloc_free(block->defin); + ralloc_free(block->defout); ralloc_free(block->use); ralloc_free(block->live_in); ralloc_free(block->live_out);