st/mesa: Fix memory leak on error path.

Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
Vinson Lee
2011-11-05 22:36:08 -07:00
parent f4515d106c
commit 3210cad3f2

View File

@@ -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);