diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-04 20:57:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-04 23:11:04 +0200 |
commit | cfc1a628d59ac36186a643468065a6a826386131 (patch) | |
tree | 9f4f952a69944c23b6a710ba9f9a4c1ba04cb627 /Kernel | |
parent | 5e2e17c38cb97c382ac32af850e1e6c4109124c6 (diff) | |
download | serenity-cfc1a628d59ac36186a643468065a6a826386131.zip |
Kernel: Add missing error check after Process::try_create()
As the name now suggests, this API can fail. :^)
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index fbad68adc1..f10065d793 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -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; |