From: Ian Romanick Date: Tue, 27 Oct 2009 18:46:29 +0000 (-0700) Subject: ARB prog parser: Don't leak program string X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8df9587d68752f3369cc1eda1606d3b7c1041ec6;p=mesa.git ARB prog parser: Don't leak program string The program string is kept in the program object. On the second call into glProgramStringARB the previous kept string would be leaked. --- diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index ae9e15ae5ae..c3152aa2f88 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2278,6 +2278,10 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_memcpy (strz, str, len); strz[len] = '\0'; + if (state->prog->String != NULL) { + _mesa_free(state->prog->String); + } + state->prog->String = strz; state->st = _mesa_symbol_table_ctor();