mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
Kernel: Make AnonymousFile::create API OOM safe
This commit is contained in:
parent
1580eeed98
commit
d2d6ab40f9
2 changed files with 4 additions and 2 deletions
|
@ -30,6 +30,8 @@ KResultOr<int> Process::sys$anon_create(size_t size, int options)
|
|||
return ENOMEM;
|
||||
|
||||
auto anon_file = AnonymousFile::create(vmobject.release_nonnull());
|
||||
if (!anon_file)
|
||||
return ENOMEM;
|
||||
auto description_or_error = FileDescription::create(*anon_file);
|
||||
if (description_or_error.is_error())
|
||||
return description_or_error.error();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue