summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-04-28 15:40:11 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-04-28 15:40:11 +0000
commit49a80ca2bcca1c1d9c341c332c5a4b07b6b3b2fd (patch)
tree829388622f163248a480c0da82312642857f0455 /src
parentc4fe46f0b8b45407ea40500b869ae1beca71063c (diff)
fix first memory leak (bug 5557)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/arbprogparse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index de63c50b36..b52525e669 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -3884,6 +3884,10 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target,
err = !grammar_check(grammar_syn_id, (byte *) arb_grammar_text,
&parsed, &parsed_len);
+ /* 'parsed' is unused here */
+ _mesa_free (parsed);
+ parsed = NULL;
+
/* NOTE: we can't destroy grammar_syn_id right here because
* grammar_destroy() can reset the last error
*/
@@ -3956,6 +3960,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target,
/* Syntax parse error */
if (err) {
_mesa_free(strz);
+ _mesa_free(parsed);
grammar_get_last_error ((GLubyte *) error_msg, 300, &error_pos);
_mesa_set_program_error (ctx, error_pos, error_msg);
_mesa_error (ctx, GL_INVALID_OPERATION,