From: Ernestas Kulik Date: Thu, 30 Aug 2018 16:02:44 +0000 (+0300) Subject: glsl_to_tgsi: Fix potential leak X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d49904085a1c4054da247a54d3787ec34ef7c900;p=mesa.git glsl_to_tgsi: Fix potential leak Reported by Coverity: arr_live_ranges is freed in a different branch than the one in which it was allocated. Signed-off-by: Ernestas Kulik Signed-off-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 7b96947c607..68573f628db 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5616,10 +5616,11 @@ glsl_to_tgsi_visitor::merge_registers(void) this->next_array = merge_arrays(this->next_array, this->array_sizes, &this->instructions, arr_live_ranges); - - if (arr_live_ranges) - delete[] arr_live_ranges; } + + if (arr_live_ranges) + delete[] arr_live_ranges; + ralloc_free(reg_live_ranges); }