]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Plug a leak
authorPetr Machata <pmachata@redhat.com>
Mon, 30 Nov 2009 06:46:32 +0000 (07:46 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 18 Aug 2010 12:55:14 +0000 (14:55 +0200)
src/dwarflint/checks.hh
src/dwarflint/dwarflint.cc

index a903b15c2eb27733b55b9143b81295a81446f761..aba996e918c2bf9785bd4cacb5049073c0c0505b 100644 (file)
@@ -34,6 +34,7 @@ struct check_base
 {
   struct failed {};
   struct unscheduled: public failed {};
+  virtual ~check_base () {}
 };
 
 template<class T>
index 50a2fa528b587cd28a0c2109557e5b2044007f56..3e23ec239253468cb8538fc689ee89fe40b77f87 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "dwarflint.hh"
 #include "messages.h"
+#include "checks.hh"
+
 #include <fcntl.h>
 #include <cstring>
 #include <cerrno>
@@ -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;
 }