mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-30 07:09:49 -06:00
Utilities/Memory Viewer: Fix memory leak
This commit is contained in:
parent
137f37cd41
commit
87d5f45277
@ -898,9 +898,15 @@ void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format form
|
||||
}
|
||||
|
||||
const auto originalBuffer = static_cast<u8*>(this->to_ptr(addr, memsize));
|
||||
|
||||
if (!originalBuffer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto convertedBuffer = new (std::nothrow) u8[memsize];
|
||||
|
||||
if (!originalBuffer || !convertedBuffer)
|
||||
if (!convertedBuffer)
|
||||
{
|
||||
// OOM or invalid memory address, give up
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user