projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f255d1
)
ARB prog parser: Don't leak program string
author
Ian Romanick
<ian.d.romanick@intel.com>
Tue, 27 Oct 2009 18:46:29 +0000
(11:46 -0700)
committer
Ian Romanick
<ian.d.romanick@intel.com>
Wed, 28 Oct 2009 00:06:18 +0000
(17:06 -0700)
The program string is kept in the program object. On the second call
into glProgramStringARB the previous kept string would be leaked.
src/mesa/shader/program_parse.y
patch
|
blob
|
history
diff --git
a/src/mesa/shader/program_parse.y
b/src/mesa/shader/program_parse.y
index ae9e15ae5ae05151ee7285a2569638d1cf120d98..c3152aa2f88d7f05030a204452c7d5fe9d19985c 100644
(file)
--- 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();