[Mesa-dev] [PATCH 1/4] glsl_to_tgsi: Fix potential leak

Marek Olšák maraeo at gmail.com
Tue Sep 4 18:04:34 UTC 2018


Thanks. I've pushed this and the u_vbuf patch.

Marek

On Thu, Aug 30, 2018 at 12:02 PM, Ernestas Kulik
<ernestas.kulik at gmail.com> wrote:
> Reported by Coverity: arr_live_ranges is freed in a different branch
> than the one in which it was allocated.
>
> CID: 1438391
> Signed-off-by: Ernestas Kulik <ernestas.kulik at gmail.com>
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 ++++---
>  1 file 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 7b96947c60..68573f628d 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);
>  }
>
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list