Re: Memory allocation problem with flex&bison

[email protected]
Newsgroups gmane.comp.gnu.utils
Organization http://groups.google.com
Message-ID <[email protected]>
Ok, I have the solution:
 + Make a list with the address of all allocation
 + Free the memory when you want.

:-) Thanks...

[email protected] wrote:
> Hi groups,
>
> I have a problem using flex to parse a file.
>
> The following rules has been defined:
>
> {space}{alnum}        {
>   yylval.string=(char*)strdup(yytext);
>   return(ALNUM);
> }
>
> But as described in the strdup manual, a memory allocation is done. I
> have a leak and I would like to know where to put the free memory
> allocation:in the flex code or in the bison code ?
> 
> I'm not expert in flex&bison, I need a good help.
> 
> José
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.