From: Vinson Lee Date: Sun, 24 Feb 2013 00:49:37 +0000 (-0800) Subject: st/vega: Fix memory leak in combine_shaders. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f88ed1658c666a36a6b42886ee0609858a8fb86e;p=mesa.git st/vega: Fix memory leak in combine_shaders. Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee Reviewed-by: Brian Paul --- diff --git a/src/gallium/state_trackers/vega/shaders_cache.c b/src/gallium/state_trackers/vega/shaders_cache.c index eceae54051e..c1082ca3673 100644 --- a/src/gallium/state_trackers/vega/shaders_cache.c +++ b/src/gallium/state_trackers/vega/shaders_cache.c @@ -225,8 +225,10 @@ combine_shaders(const struct shader_asm_info *shaders[SHADER_STAGES], int num_sh ureg_END(ureg); shader->tokens = ureg_finalize(ureg); - if(!shader->tokens) + if (!shader->tokens) { + ureg_destroy(ureg); return NULL; + } p = pipe->create_fs_state(pipe, shader);