summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2016-04-21 20:34:04 +0200
committerBas Nieuwenhuizen <[email protected]>2016-04-26 15:41:19 +0200
commit31631d8515924df0dbaefd8bea3530dc5a4d02c8 (patch)
tree23b63350a04769ce73fa209e664a1872c424c606 /src/gallium
parent514c5b5f4b692e2596341e08797c4f6dc8cdfe00 (diff)
radeonsi: Fix memory leak in error path.
Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_compute.c2
1 files changed, 2 insertions, 0 deletions
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;
}