diff options
author | Ernestas Kulik <[email protected]> | 2018-08-30 19:02:44 +0300 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-09-04 14:01:43 -0400 |
commit | d49904085a1c4054da247a54d3787ec34ef7c900 (patch) | |
tree | aec3b06bb5d8916d3344af86a68d81f31428840d /src/mesa/state_tracker | |
parent | ea1e50cc166ae855f9fa91ca6a4f944123298e4e (diff) |
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 <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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); } |