diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-12 18:10:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-12 18:10:12 +0000 |
commit | bbea1245a1b7e2bce79fe34d9331dab2e42fa3a4 (patch) | |
tree | 685d6a7bdc7fbb02380b7d6ad027bc4c0207d040 /lib | |
parent | b5d9319bc585d872b59967eec71ada21a3bbd497 (diff) |
Fix a hypothetical memory leak, identified by Coverity. In practice, this
object is never deleted though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITEmitter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index 2a62bd3557..00b23c1738 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -392,12 +392,14 @@ JITMemoryManager::JITMemoryManager(bool useGOT) { // Allocate the GOT. GOTBase = NULL; - if (useGOT) GOTBase = (unsigned char*)malloc(sizeof(void*) * 8192); + if (useGOT) GOTBase = new unsigned char[sizeof(void*) * 8192]; } JITMemoryManager::~JITMemoryManager() { for (unsigned i = 0, e = Blocks.size(); i != e; ++i) sys::Memory::ReleaseRWX(Blocks[i]); + + delete[] GOTBase; Blocks.clear(); } |