From 687be046789e2f509ccf93155456c47f3f463e0c Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Sun, 30 Jan 2011 13:25:12 +0100 Subject: [PATCH] Reported by cppcheck: fix a memory leak --- src/Model/modelmgr.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx index 3478a68c5..181435ef1 100644 --- a/src/Model/modelmgr.cxx +++ b/src/Model/modelmgr.cxx @@ -83,6 +83,7 @@ FGModelMgr::add_model (SGPropertyNode * node) } catch (const sg_throwable& t) { SG_LOG(SG_GENERAL, SG_ALERT, "Error loading " << path << ":\n " << t.getFormattedMessage() << t.getOrigin()); + delete instance; return; }