summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-28 05:04:18 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-29 09:04:05 +0200
commitd570048c9ee4748250f4ff7cd98c728e2ad23e76 (patch)
tree6c5bbd11bb433981dce62f63ce3a009c1941c1b8 /Kernel
parent32f96eb937bdad324c28bcd875d6340261bd1e12 (diff)
downloadserenity-d570048c9ee4748250f4ff7cd98c728e2ad23e76.zip
Kernel: Make CoreDump::create API OOM safe
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/CoreDump.cpp2
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)