[Mesa-dev] [PATCH] mesa: Fix memory leak on error path.

Vinson Lee vlee at vmware.com
Fri Dec 16 06:45:33 PST 2011


Fixes Coverity resource leak defect.

Signed-off-by: Vinson Lee <vlee at vmware.com>
---
 src/mesa/program/prog_parameter_layout.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/prog_parameter_layout.c b/src/mesa/program/prog_parameter_layout.c
index 28fca3b..e4f2db3 100644
--- a/src/mesa/program/prog_parameter_layout.c
+++ b/src/mesa/program/prog_parameter_layout.c
@@ -138,6 +138,7 @@ _mesa_layout_parameters(struct asm_parser_state *state)
 		      inst->SrcReg[i].Symbol->param_binding_length);
 
 	       if (new_begin < 0) {
+		  _mesa_free_parameter_list(layout);
 		  return GL_FALSE;
 	       }
 
-- 
1.7.7.3



More information about the mesa-dev mailing list