From 6a769d97e3ad0c5275f918b9f36519d6c0254da3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 28 Apr 2006 15:42:15 +0000 Subject: [PATCH] fix second memory leak (bug 5557) --- src/mesa/shader/arbprogparse.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index b52525e669f..b596b79bc79 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -518,7 +518,7 @@ typedef enum */ struct var_cache { - GLubyte *name; + const GLubyte *name; /* don't free() - no need */ var_type type; GLuint address_binding; /* The index of the address register we should * be using */ @@ -641,7 +641,7 @@ parse_string (GLubyte ** inst, struct var_cache **vc_head, *found = 0; var_cache_create (&va); - va->name = i; + va->name = (const GLubyte *) i; var_cache_append (vc_head, va); @@ -828,6 +828,7 @@ static GLuint parse_relative_offset (GLcontext *ctx, GLubyte **inst, struct arb_program *Program, GLint *offset) { + (void) ctx; *offset = parse_integer(inst, Program); return 0; } @@ -1936,7 +1937,7 @@ parse_param_use (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, /* First, insert a dummy entry into the var_cache */ var_cache_create (¶m_var); - param_var->name = (GLubyte *) _mesa_strdup (" "); + param_var->name = (const GLubyte *) " "; param_var->type = vt_param; param_var->param_binding_length = 0; @@ -2466,7 +2467,7 @@ parse_src_reg (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, */ var_cache_create(&src); src->type = vt_attrib; - src->name = (GLubyte *)_mesa_strdup("Dummy Attrib Variable"); + src->name = (const GLubyte *) "Dummy Attrib Variable"; src->attrib_binding = binding; src->attrib_is_generic = is_generic; var_cache_append(vc_head, src); -- 2.30.2