diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2009-10-27 11:46:29 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-10-27 17:06:18 -0700 |
commit | 8df9587d68752f3369cc1eda1606d3b7c1041ec6 (patch) | |
tree | cb06b8c324442556aef30307d2173fe3babf1aa0 /src/mesa | |
parent | 0f255d195651f104a0c0bed84039b656d94ac4cc (diff) | |
download | external_mesa3d-8df9587d68752f3369cc1eda1606d3b7c1041ec6.zip external_mesa3d-8df9587d68752f3369cc1eda1606d3b7c1041ec6.tar.gz external_mesa3d-8df9587d68752f3369cc1eda1606d3b7c1041ec6.tar.bz2 |
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.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/program_parse.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index ae9e15a..c3152aa 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(); |