From: Petr Machata Date: Mon, 30 Nov 2009 06:46:32 +0000 (+0100) Subject: dwarflint: Plug a leak X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=366533f7dd08bee4dee9dced98731e0a3481d6ef;p=thirdparty%2Felfutils.git dwarflint: Plug a leak --- diff --git a/src/dwarflint/checks.hh b/src/dwarflint/checks.hh index a903b15c2..aba996e91 100644 --- a/src/dwarflint/checks.hh +++ b/src/dwarflint/checks.hh @@ -34,6 +34,7 @@ struct check_base { struct failed {}; struct unscheduled: public failed {}; + virtual ~check_base () {} }; template diff --git a/src/dwarflint/dwarflint.cc b/src/dwarflint/dwarflint.cc index 50a2fa528..3e23ec239 100644 --- a/src/dwarflint/dwarflint.cc +++ b/src/dwarflint/dwarflint.cc @@ -25,6 +25,8 @@ #include "dwarflint.hh" #include "messages.h" +#include "checks.hh" + #include #include #include @@ -62,4 +64,7 @@ dwarflint::~dwarflint () // Not that we can do anything about it... wr_error () << "Couldn't close the file " << _m_fname << ": " << strerror (errno) << "." << std::endl; + for (check_map::const_iterator it = _m_checks.begin (); + it != _m_checks.end (); ++it) + delete it->second; }