forked from OSchip/llvm-project
Fix a hypothetical memory leak, identified by Coverity. In practice, this
object is never deleted though. llvm-svn: 28256
This commit is contained in:
parent
53cdb2f2b0
commit
1fe2d2c600
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue