mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-09 22:04:10 +00:00
Avoid a memory leak in JITDebugRegisterer.
llvm-svn: 98612
This commit is contained in:
parent
545aba3681
commit
4eb3242b81
@ -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…
x
Reference in New Issue
Block a user