1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

Kernel: Add missing error check after Process::try_create()

As the name now suggests, this API can fail. :^)
This commit is contained in:
Andreas Kling 2021-09-04 20:57:33 +02:00
parent 5e2e17c38c
commit cfc1a628d5

View file

@ -157,7 +157,7 @@ RefPtr<Process> Process::create_user_process(RefPtr<Thread>& first_thread, const
cwd = VirtualFileSystem::the().root_custody();
auto process = Process::try_create(first_thread, parts.take_last(), uid, gid, parent_pid, false, move(cwd), nullptr, tty);
if (!first_thread)
if (!process || !first_thread)
return {};
if (!process->m_fds.try_resize(process->m_fds.max_open())) {
first_thread = nullptr;