about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorMartin Nowack <martin.nowack@gmail.com>2013-08-13 16:29:29 +0200
committerMartin Nowack <martin@se.inf.tu-dresden.de>2013-12-05 00:55:06 +0100
commit51adb568d44540a33743dc8513053b49321f1f4c (patch)
treea64bc22ba204dfca9f84f0b322ea3d6253865f96 /lib/Module
parent0675b9f7f3cd66c92d9babd1ccee2dcc47bdfafc (diff)
downloadklee-51adb568d44540a33743dc8513053b49321f1f4c.tar.gz
Free used constants if not used anymore
Fixes memleak
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/KModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index ff13efda..7b23a9c9 100644
--- a/lib/Module/KModule.cpp
+++ b/lib/Module/KModule.cpp
@@ -127,6 +127,10 @@ KModule::~KModule() {
          ie = functions.end(); it != ie; ++it)
     delete *it;
 
+  for (std::map<llvm::Constant*, KConstant*>::iterator it=constantMap.begin(),
+      itE=constantMap.end(); it!=itE;++it)
+    delete it->second;
+
   delete targetData;
   delete module;
 }