[Mesa-dev] [PATCH 2/2] radeonsi: Fix memory leak in error path.

Marek Olšák maraeo at gmail.com
Fri Apr 22 07:21:49 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Apr 21, 2016 at 8:51 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
>  src/gallium/drivers/radeonsi/si_compute.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
> index a99a985..29dbdd8 100644
> --- a/src/gallium/drivers/radeonsi/si_compute.c
> +++ b/src/gallium/drivers/radeonsi/si_compute.c
> @@ -71,6 +71,7 @@ static void *si_create_compute_state(
>
>                 sel.tokens = tgsi_dup_tokens(cso->prog);
>                 if (!sel.tokens) {
> +                       FREE(program);
>                         return NULL;
>                 }
>
> @@ -85,6 +86,7 @@ static void *si_create_compute_state(
>                 if (si_shader_create(sscreen, sctx->tm, &program->shader,
>                                      &sctx->b.debug)) {
>                         FREE(sel.tokens);
> +                       FREE(program);
>                         return NULL;
>                 }
>
> --
> 2.8.0
>
> _______________________________________________
> 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