summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-05-14 01:04:02 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-05-18 23:35:20 -0700
commit81b11bf0934d5387bd3741b6268501df3973a6a7 (patch)
treead2aa2d6f562f0af4c91e66ca07f47e36b8b1796 /src/mesa
parentc96fdeb723dd92ec7dfed908e41e6ad401c36ff3 (diff)
downloadexternal_mesa3d-81b11bf0934d5387bd3741b6268501df3973a6a7.zip
external_mesa3d-81b11bf0934d5387bd3741b6268501df3973a6a7.tar.gz
external_mesa3d-81b11bf0934d5387bd3741b6268501df3973a6a7.tar.bz2
i965/fs: Actually free program data on the error path.
We throw away the data generated during compilation on the success path, so we really ought to on the failure path as well. The caller has no access to it anyway, so it's purely leaked. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 5242715..059d848 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -181,8 +181,10 @@ bool do_wm_prog(struct brw_context *brw,
&fp->program);
program = brw_wm_fs_emit(brw, c, &fp->program, prog, &program_size);
- if (program == NULL)
+ if (program == NULL) {
+ ralloc_free(c);
return false;
+ }
if (c->prog_data.total_scratch) {
brw_get_scratch_bo(brw, &brw->wm.base.scratch_bo,