mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
_sys_ppu_thread_create: fix memory leak on error
This commit is contained in:
@@ -526,6 +526,7 @@ error_code _sys_ppu_thread_create(ppu_thread& ppu, vm::ptr<u64> thread_id, vm::p
|
||||
|
||||
if (!vm::read_string(threadname.addr(), max_size, ppu_name, true))
|
||||
{
|
||||
vm::dealloc(stack_base);
|
||||
dct.free(stack_size);
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
@@ -365,6 +365,8 @@ std::function<void(void*)> lv2_prx::load(utils::serial& ar)
|
||||
u128 klic = g_fxo->get<loaded_npdrm_keys>().last_key();
|
||||
file = make_file_view(std::move(file), offset, umax);
|
||||
prx = ppu_load_prx(ppu_prx_object{decrypt_self(std::move(file), reinterpret_cast<u8*>(&klic))}, false, path, offset, &ar);
|
||||
ensure(prx);
|
||||
|
||||
prx->m_loaded_flags = std::move(loaded_flags);
|
||||
prx->m_external_loaded_flags = std::move(external_flags);
|
||||
|
||||
@@ -372,8 +374,6 @@ std::function<void(void*)> lv2_prx::load(utils::serial& ar)
|
||||
{
|
||||
prx->restore_exports();
|
||||
}
|
||||
|
||||
ensure(prx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user