From 5252d38313c423465b9bc37b0618cb8de96d0d4e Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Fri, 31 Jul 2009 17:54:16 +0200 Subject: [PATCH 1/1] Fixed memory leak. --- ginac/parser/parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.44.0