mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
Close memory leak in lexer.
Simply call talloc_strdup rather than strdup, (using the talloc_parent of our 'state' object, (known here as yyextra). This fix now makes glsl-orangebook-ch06-bump.frag 99.97% leak free: total heap usage: 55,623 allocs, 55,609 frees Only 14 missing frees now.
This commit is contained in:
parent
a9696e79fb
commit
dc5811fd0c
1 changed files with 3 additions and 1 deletions
|
|
@ -312,7 +312,9 @@ highp return HIGHP;
|
|||
precision return PRECISION;
|
||||
|
||||
[_a-zA-Z][_a-zA-Z0-9]* {
|
||||
yylval->identifier = strdup(yytext);
|
||||
struct _mesa_glsl_parse_state *state = yyextra;
|
||||
void *ctx = talloc_parent(state);
|
||||
yylval->identifier = talloc_strdup(ctx, yytext);
|
||||
return IDENTIFIER;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue