Skip to content

Commit

Permalink
Kernel: Make CoreDump::create API OOM safe
Browse files Browse the repository at this point in the history
  • Loading branch information
bgianfo authored and awesomekling committed May 29, 2021
1 parent 32f96eb commit d570048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/CoreDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ OwnPtr<CoreDump> CoreDump::create(NonnullRefPtr<Process> process, const String&
auto fd = create_target_file(process, output_path);
if (!fd)
return {};
return adopt_own(*new CoreDump(move(process), fd.release_nonnull()));
return adopt_own_if_nonnull(new CoreDump(move(process), fd.release_nonnull()));
}

CoreDump::CoreDump(NonnullRefPtr<Process> process, NonnullRefPtr<FileDescription>&& fd)
Expand Down

0 comments on commit d570048

Please sign in to comment.