X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fparser%2Fparser.cpp;h=6ed364ffd5a155ae0bb5abeec567a8f17e3ffbaf;hp=818203162e7dc4421d61a30af8613e3353b60653;hb=5252d38313c423465b9bc37b0618cb8de96d0d4e;hpb=7a092f6f6256bac2e5b7c35222fe7e18ca980401 diff --git a/ginac/parser/parser.cpp b/ginac/parser/parser.cpp index 81820316..6ed364ff 100644 --- a/ginac/parser/parser.cpp +++ b/ginac/parser/parser.cpp @@ -68,11 +68,12 @@ ex parser::parse_identifier_expr() } // dirty hack to distinguish between serial numbers of functions and real // pointers. - GiNaC::function* f; + GiNaC::function* f = NULL; try { f = new GiNaC::function(reinterpret_cast(reader->second), args); } catch ( std::runtime_error ) { + if ( f ) delete f; ex ret = reader->second(args); return ret; }