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 <ernestas.kulik@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Ernestas Kulik
2018-08-30 19:02:44 +03:00
committed by Marek Olšák
parent ea1e50cc16
commit d49904085a
+4 -3
View File
@@ -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);
}