projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5d9319
)
Fix a hypothetical memory leak, identified by Coverity. In practice, this
author
Chris Lattner
<sabre@nondot.org>
Fri, 12 May 2006 18:10:12 +0000
(18:10 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Fri, 12 May 2006 18:10:12 +0000
(18:10 +0000)
object is never deleted though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28256
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/ExecutionEngine/JIT/JITEmitter.cpp
patch
|
blob
|
history
diff --git
a/lib/ExecutionEngine/JIT/JITEmitter.cpp
b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 2a62bd3557c5f95c848fa42592090826cf8138f3..00b23c173888451ae64f179db33e2a9851537521 100644
(file)
--- 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();
}