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

Nicolai Hähnle nhaehnle at gmail.com
Fri Apr 22 04:18:39 UTC 2016


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 21.04.2016 13:51, Bas Nieuwenhuizen 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;
>   		}
>
>


More information about the mesa-dev mailing list