mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Avoid a memory leak in JITDebugRegisterer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7cfb6d373a
commit
6efed73eb5
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user