summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2012-08-04 14:04:03 -0700
committerVinson Lee <[email protected]>2012-08-06 22:08:56 -0700
commit7d65356d8a4d268dce4c933d7704d709e1cdacfa (patch)
treefe62dfe1851ad37b79f4058366840c1ac50c79f2 /src/mesa/state_tracker
parentc3894bc2d5d5eabdc913d88d1fedc552fef074a5 (diff)
st/mesa: Fix a potential memory leak in get_mesa_program.
Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp3
1 files changed, 2 insertions, 1 deletions
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;