From: Bas Nieuwenhuizen Date: Thu, 21 Apr 2016 18:34:04 +0000 (+0200) Subject: radeonsi: Fix memory leak in error path. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31631d8515924df0dbaefd8bea3530dc5a4d02c8;p=mesa.git radeonsi: Fix memory leak in error path. Signed-off-by: Bas Nieuwenhuizen Reviewed-by: Nicolai Hähnle Reviewed-by: Marek Olšák --- diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 7e05be55124..09cbe1337ef 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -70,6 +70,7 @@ static void *si_create_compute_state( sel.tokens = tgsi_dup_tokens(cso->prog); if (!sel.tokens) { + FREE(program); return NULL; } @@ -84,6 +85,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; }