mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
Utilities/Memory Viewer: Fix memory leak
This commit is contained in:
parent
137f37cd41
commit
87d5f45277
1 changed files with 7 additions and 1 deletions
|
@ -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));
|
const auto originalBuffer = static_cast<u8*>(this->to_ptr(addr, memsize));
|
||||||
|
|
||||||
|
if (!originalBuffer)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto convertedBuffer = new (std::nothrow) u8[memsize];
|
const auto convertedBuffer = new (std::nothrow) u8[memsize];
|
||||||
|
|
||||||
if (!originalBuffer || !convertedBuffer)
|
if (!convertedBuffer)
|
||||||
{
|
{
|
||||||
// OOM or invalid memory address, give up
|
// OOM or invalid memory address, give up
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue