mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Kernel: Only instantiate main_program_metadata in the scope it's needed
pvs-studio flagged this as a potential perf optimization.
This commit is contained in:
parent
b530201111
commit
e8ec1e908d
1 changed files with 1 additions and 2 deletions
|
@ -454,8 +454,6 @@ KResult Process::do_exec(NonnullRefPtr<OpenFileDescription> main_program_descrip
|
|||
auto new_process_name = TRY(KString::try_create(parts.last()));
|
||||
auto new_main_thread_name = TRY(new_process_name->try_clone());
|
||||
|
||||
auto main_program_metadata = main_program_description->metadata();
|
||||
|
||||
auto load_result = TRY(load(main_program_description, interpreter_description, main_program_header));
|
||||
|
||||
// NOTE: We don't need the interpreter executable description after this point.
|
||||
|
@ -488,6 +486,7 @@ KResult Process::do_exec(NonnullRefPtr<OpenFileDescription> main_program_descrip
|
|||
bool executable_is_setid = false;
|
||||
|
||||
if (!(main_program_description->custody()->mount_flags() & MS_NOSUID)) {
|
||||
auto main_program_metadata = main_program_description->metadata();
|
||||
if (main_program_metadata.is_setuid()) {
|
||||
executable_is_setid = true;
|
||||
ProtectedDataMutationScope scope { *this };
|
||||
|
|
Loading…
Add table
Reference in a new issue