aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2011-11-05 22:36:08 -0700
committerVinson Lee <[email protected]>2011-11-07 20:41:21 -0800
commit3210cad3f26a7e8a73f2dc2f7f3740e594b068bd (patch)
tree85114c3bfdd072a8a222e566655ef246dd8674eb
parentf4515d106cd40351133c89855e3277a70bba8721 (diff)
st/mesa: Fix memory leak on error path.
Fixes Coverity resource leak defect. Reviewed-by: José Fonseca <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_program.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 6c1568dcfa9..e03157940b1 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -636,8 +636,10 @@ st_translate_fragment_program(struct st_context *st,
}
ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT );
- if (ureg == NULL)
+ if (ureg == NULL) {
+ FREE(variant);
return NULL;
+ }
if (ST_DEBUG & DEBUG_MESA) {
_mesa_print_program(&stfp->Base.Base);