forked from OSchip/llvm-project
Avoid a memory leak in JITDebugRegisterer.
llvm-svn: 98612
This commit is contained in:
parent
f857e0bbe7
commit
7d83d9b23c
|
@ -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