From: Jens Vollinga Date: Fri, 31 Jul 2009 15:54:16 +0000 (+0200) Subject: Fixed memory leak. X-Git-Tag: release_1-6-0~25 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=4b8098a96848d75490e04ba4746f67acb74daa9f Fixed memory leak. --- diff --git a/ginac/parser/parser.cpp b/ginac/parser/parser.cpp index 3fa40c92..52f7e1df 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; }