From: Brian Paul Date: Fri, 28 Apr 2006 15:40:11 +0000 (+0000) Subject: fix first memory leak (bug 5557) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49a80ca2bcca1c1d9c341c332c5a4b07b6b3b2fd;p=mesa.git fix first memory leak (bug 5557) --- diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index de63c50b36a..b52525e669f 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,