mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 08:06:09 +00:00
Kernel: Perform exec-into-new-image directly in sys$execve()
This ensures that everything allocated on the stack in Process::exec() gets cleaned up. We had a few leaks related to the parsing of shebang (#!) executables that get fixed by this.
This commit is contained in:
@@ -151,7 +151,9 @@ ErrorOr<NonnullRefPtr<Process>> Process::try_create_user_process(RefPtr<Thread>&
|
||||
setup_description(1);
|
||||
setup_description(2);
|
||||
|
||||
if (auto result = process->exec(move(path_string), move(arguments), move(environment)); result.is_error()) {
|
||||
Thread* new_main_thread = nullptr;
|
||||
u32 prev_flags = 0;
|
||||
if (auto result = process->exec(move(path_string), move(arguments), move(environment), new_main_thread, prev_flags); result.is_error()) {
|
||||
dbgln("Failed to exec {}: {}", path, result.error());
|
||||
first_thread = nullptr;
|
||||
return result.release_error();
|
||||
|
||||
Reference in New Issue
Block a user