From 7d65356d8a4d268dce4c933d7704d709e1cdacfa Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 4 Aug 2012 14:04:03 -0700 Subject: [PATCH] st/mesa: Fix a potential memory leak in get_mesa_program. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee Reviewed-by: José Fonseca --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index fcd69b18d3a..66627acb6fc 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -4790,7 +4790,7 @@ get_mesa_program(struct gl_context *ctx, struct gl_shader_program *shader_program, struct gl_shader *shader) { - glsl_to_tgsi_visitor* v = new glsl_to_tgsi_visitor(); + glsl_to_tgsi_visitor* v; struct gl_program *prog; GLenum target; const char *target_string; @@ -4822,6 +4822,7 @@ get_mesa_program(struct gl_context *ctx, if (!prog) return NULL; prog->Parameters = _mesa_new_parameter_list(); + v = new glsl_to_tgsi_visitor(); v->ctx = ctx; v->prog = prog; v->shader_program = shader_program; -- 2.30.2