Tis does not work in the case of syntax input errors, though, because
then the action is not executed. So then a way forward is to use %
destructor, somehow. You might want creating a new Help-Bison thread
about cleanups, to get the attention of some of the experts on this.
On 18 Apr 2006, at 15:02, Arno Wilhelm wrote:
Hello,
But I get a memory leak even when I free the the in the bison file
like this:
WORD EQUAL WORD { $$ = !strncmp( $1, $3, 128 ); free
( yylval.str ); }
have found out how to avoid the memory leak myself and thought I
would post it here
in case somebody runs into the same issue.
One has to free the variables like this:
WORD EQUAL WORD { $$ = !strcmp( $1, $3 ); free($1); free($3); }
regards,
arno
_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison