Fix a hypothetical memory leak, identified by Coverity. In practice, this

object is never deleted though.

llvm-svn: 28256
This commit is contained in:
Chris Lattner 2006-05-12 18:10:12 +00:00
parent 53cdb2f2b0
commit 1fe2d2c600
1 changed files with 3 additions and 1 deletions

View File

@ -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();
}