mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:57:34 +00:00
Userland: Use allocation-failure safe functions where it's easy
I went through all callers of adopt_own() and replaced them with try_make<>() if possible or adopt_nonnull_own_or_enomem() else in cases where it was easy (i.e. in functions already returning ErrorOr). No intended behavior change.
This commit is contained in:
parent
f698585097
commit
9cfd7a299c
4 changed files with 7 additions and 7 deletions
|
@ -12,7 +12,7 @@ ErrorOr<NonnullOwnPtr<ObjectFile>> Compiler::compile(Vector<String> const&)
|
|||
{
|
||||
// FIXME: implement this function
|
||||
m_messages = {};
|
||||
return adopt_own(*new ObjectFile());
|
||||
return try_make<ObjectFile>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue