diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-16 05:54:54 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-03-16 05:54:54 +0000 |
commit | 6efed73eb5c090285bd574c3ec6780ad771c40c6 (patch) | |
tree | 9649073de7fac01c199e6b4d331d06f451cb9267 /lib/ExecutionEngine | |
parent | 7cfb6d373a8062f3ade6fb42b7890dae5233619c (diff) |
Avoid a memory leak in JITDebugRegisterer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp b/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp index 565509cd1f3..68471bd4d5f 100644 --- a/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp +++ b/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp @@ -165,7 +165,7 @@ void JITDebugRegisterer::RegisterFunction(const Function *F, DebugInfo &I) { void JITDebugRegisterer::UnregisterFunctionInternal( RegisteredFunctionsMap::iterator I) { - jit_code_entry *JITCodeEntry = I->second.second; + jit_code_entry *&JITCodeEntry = I->second.second; // Acquire the lock and do the unregistration. { @@ -190,6 +190,9 @@ void JITDebugRegisterer::UnregisterFunctionInternal( __jit_debug_register_code(); } + delete JITCodeEntry; + JITCodeEntry = NULL; + // Free the ELF file in memory. std::string &Buffer = I->second.first; Buffer.clear(); |