From f88ed1658c666a36a6b42886ee0609858a8fb86e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 23 Feb 2013 16:49:37 -0800 Subject: [PATCH] st/vega: Fix memory leak in combine_shaders. Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee Reviewed-by: Brian Paul --- src/gallium/state_trackers/vega/shaders_cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/vega/shaders_cache.c b/src/gallium/state_trackers/vega/shaders_cache.c index eceae54..c1082ca 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); -- 2.7.4