mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-12-06 07:12:28 +01: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 a new issue