_sys_ppu_thread_create: fix memory leak on error

This commit is contained in:
Megamouse
2026-10-01 10:49:10 +03:00
committed by Elad
parent 5b350ff3e1
commit 71d1a4527d
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -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;
}
+2 -2
View File
@@ -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
{