mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-28 22:33:21 +00:00
memctrlbase: fix possible memory leak.
This commit is contained in:
parent
6aa54b8dda
commit
9ade14e076
@ -200,8 +200,6 @@ bool MemCtrlBase::add_mem_mirror_common(uint32_t start_addr, uint32_t dest_addr,
|
||||
if (!ref_entry)
|
||||
return false;
|
||||
|
||||
entry = new AddressMapEntry;
|
||||
|
||||
// use origin's size if no size was specified
|
||||
if (!size)
|
||||
size = ref_entry->end - ref_entry->start + 1;
|
||||
@ -212,6 +210,8 @@ bool MemCtrlBase::add_mem_mirror_common(uint32_t start_addr, uint32_t dest_addr,
|
||||
return false;
|
||||
}
|
||||
|
||||
entry = new AddressMapEntry;
|
||||
|
||||
uint32_t end = start_addr + size - 1;
|
||||
entry->start = start_addr;
|
||||
entry->end = end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user