From cfc1a628d59ac36186a643468065a6a826386131 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 4 Sep 2021 20:57:33 +0200 Subject: [PATCH] Kernel: Add missing error check after Process::try_create() As the name now suggests, this API can fail. :^) --- Kernel/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::create_user_process(RefPtr& 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;