|
From: | Hans Aberg |
Subject: | Re: Different behaviour with string and number tokens ? |
Date: | Tue, 18 Apr 2006 15:47:42 +0200 |
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 herein 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
[Prev in Thread] | Current Thread | [Next in Thread] |