From: Vinson Lee Date: Sun, 6 Nov 2011 05:36:08 +0000 (-0700) Subject: st/mesa: Fix memory leak on error path. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3210cad3f26a7e8a73f2dc2f7f3740e594b068bd;p=mesa.git st/mesa: Fix memory leak on error path. Fixes Coverity resource leak defect. Reviewed-by: José Fonseca --- 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);