summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-04 20:57:33 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-04 23:11:04 +0200
commitcfc1a628d59ac36186a643468065a6a826386131 (patch)
tree9f4f952a69944c23b6a710ba9f9a4c1ba04cb627 /Kernel
parent5e2e17c38cb97c382ac32af850e1e6c4109124c6 (diff)
downloadserenity-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.cpp2
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;