* Fixed memory leak in ginac_yylex() [Sheplyakov].
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 21 Nov 2007 04:20:44 +0000 (04:20 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 21 Nov 2007 04:20:44 +0000 (04:20 +0000)
ginac/input_lexer.ll

index f931394889414f0c2b39153d4bcf9941c0cd7fec..bc568ceb7a03a740a83ae66adf9fc9abe2f130b8 100644 (file)
@@ -119,7 +119,9 @@ Digits                      ginac_yylval = (long)Digits; return T_DIGITS;
 {A}{AN}*               {
                                sym_tab::const_iterator i = syms.find(yytext);
                                if (i == syms.end()) {
 {A}{AN}*               {
                                sym_tab::const_iterator i = syms.find(yytext);
                                if (i == syms.end()) {
-                                       syms[yytext] = sym_def(ginac_yylval = *(new symbol(yytext)), false);
+                                       symbol tmp(yytext);
+                                       ginac_yylval = tmp;
+                                       syms[yytext] = sym_def(tmp, false);
                                } else
                                        ginac_yylval = (*i).second.sym;
                                return T_SYMBOL;
                                } else
                                        ginac_yylval = (*i).second.sym;
                                return T_SYMBOL;