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

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Apr 21 18:51:43 UTC 2016


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



More information about the mesa-dev mailing list