]> www.ginac.de Git - ginac.git/blobdiff - ginac/input_lexer.ll
* Fixed memory leak in ginac_yylex() [Sheplyakov].
[ginac.git] / ginac / input_lexer.ll
index b15af664c11b64f2cc586efea6da1d9a0b4c41a7..bc568ceb7a03a740a83ae66adf9fc9abe2f130b8 100644 (file)
@@ -4,7 +4,7 @@
  *  This file must be processed with flex. */
 
 /*
- *  GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 
@@ -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()) {
-                                       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;