diff options
Diffstat (limited to 'Kernel/Syscalls/module.cpp')
-rw-r--r-- | Kernel/Syscalls/module.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/module.cpp b/Kernel/Syscalls/module.cpp index 1ab7dd2ef0..9d267bd4ad 100644 --- a/Kernel/Syscalls/module.cpp +++ b/Kernel/Syscalls/module.cpp @@ -37,7 +37,7 @@ KResultOr<int> Process::sys$module_load(Userspace<const char*> user_path, size_t auto storage = KBuffer::create_with_size(payload.size()); memcpy(storage.data(), payload.data(), payload.size()); - auto elf_image = adopt_own_if_nonnull(new ELF::Image(storage.data(), storage.size())); + auto elf_image = try_make<ELF::Image>(storage.data(), storage.size()); if (!elf_image) return ENOMEM; if (!elf_image->parse()) @@ -45,7 +45,7 @@ KResultOr<int> Process::sys$module_load(Userspace<const char*> user_path, size_t HashMap<String, u8*> section_storage_by_name; - auto module = adopt_own_if_nonnull(new Module()); + auto module = try_make<Module>(); if (!module) return ENOMEM; |