radeonsi: Fix memory leak in error path.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 21 Apr 2016 18:34:04 +0000 (20:34 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 26 Apr 2016 13:41:19 +0000 (15:41 +0200)
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_compute.c

index 7e05be551241fd99be3e567e17096aa51ac61646..09cbe1337efde1761783b2af53203cad5b41e33a 100644 (file)
@@ -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;
                }