mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 08:06:09 +00:00
Kernel: Fix error case in Process::create_user_process()
If we fail to exec() the target executable, don't leak the thread (this actually triggers an assertion when destructing the process), and print an error message.
This commit is contained in:
committed by
Andreas Kling
parent
6627c3ea3a
commit
b6845de3f6
@@ -1345,6 +1345,8 @@ Process* Process::create_user_process(Thread*& first_thread, const String& path,
|
||||
|
||||
error = process->exec(path, move(arguments), move(environment));
|
||||
if (error != 0) {
|
||||
dbg() << "Failed to exec " << path << ": " << error;
|
||||
delete first_thread;
|
||||
delete process;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user