From 3210cad3f26a7e8a73f2dc2f7f3740e594b068bd Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 5 Nov 2011 22:36:08 -0700 Subject: [PATCH] st/mesa: Fix memory leak on error path. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes Coverity resource leak defect. Reviewed-by: José Fonseca --- src/mesa/state_tracker/st_program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.30.2