mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 14:07:42 +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:
parent
6627c3ea3a
commit
b6845de3f6
1 changed files with 2 additions and 0 deletions
|
@ -1345,6 +1345,8 @@ Process* Process::create_user_process(Thread*& first_thread, const String& path,
|
||||||
|
|
||||||
error = process->exec(path, move(arguments), move(environment));
|
error = process->exec(path, move(arguments), move(environment));
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
|
dbg() << "Failed to exec " << path << ": " << error;
|
||||||
|
delete first_thread;
|
||||||
delete process;
|
delete process;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue