[Mesa-dev] [PATCH] glsl: Fix memory leak in glsl_lexer.ll

Aras Pranckevicius aras at unity3d.com
Wed Sep 3 23:23:29 PDT 2014


>
> > --- a/src/glsl/glsl_lexer.ll
> > +++ b/src/glsl/glsl_lexer.ll
> > @@ -232,7 +232,8 @@ HASH                ^{SPC}#{SPC}
> >  <PP>[ \t\r]*                   { }
> >  <PP>:                          return COLON;
> >  <PP>[_a-zA-Z][_a-zA-Z0-9]*     {
> > -                                  yylval->identifier = strdup(yytext);
> > +                                  void *ctx = yyextra;
> > +                                  yylval->identifier =
> ralloc_strdup(ctx, yytext);
> >                                    return IDENTIFIER;
> >                                 }
> >  <PP>[1-9][0-9]*                        {
>
> There's another use of strdup() in this file. I assume it needs the
> same treatment.
>

Seems like there's a memory leak at least in extension indentifiers:
http://lists.freedesktop.org/archives/mesa-dev/2013-August/044010.html


-- 
Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140904/4f044b48/attachment.html>


More information about the mesa-dev mailing list