diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-05-28 05:04:18 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-29 09:04:05 +0200 |
commit | d570048c9ee4748250f4ff7cd98c728e2ad23e76 (patch) | |
tree | 6c5bbd11bb433981dce62f63ce3a009c1941c1b8 /Kernel | |
parent | 32f96eb937bdad324c28bcd875d6340261bd1e12 (diff) | |
download | serenity-d570048c9ee4748250f4ff7cd98c728e2ad23e76.zip |
Kernel: Make CoreDump::create API OOM safe
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/CoreDump.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/CoreDump.cpp b/Kernel/CoreDump.cpp index fd2a2f6454..840134e95a 100644 --- a/Kernel/CoreDump.cpp +++ b/Kernel/CoreDump.cpp @@ -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) |