summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-12 23:00:47 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-13 16:21:53 +0200
commit5dc5f31f76a734c1ad98b82b8081c027f18ca6a7 (patch)
tree5c6f90052765271eb3eb87d138bacc6bde55ef7c /Kernel/FileSystem
parent956314f0a185729caef7a451ab729e21d37ce02c (diff)
downloadserenity-5dc5f31f76a734c1ad98b82b8081c027f18ca6a7.zip
Kernel: Replace bare new in Custody::create() with adopt_ref_if_nonnull
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/Custody.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/Custody.h b/Kernel/FileSystem/Custody.h
index 2a27c169e7..34bbba5137 100644
--- a/Kernel/FileSystem/Custody.h
+++ b/Kernel/FileSystem/Custody.h
@@ -22,11 +22,11 @@ class Custody : public RefCounted<Custody> {
public:
static KResultOr<NonnullRefPtr<Custody>> create(Custody* parent, const StringView& name, Inode& inode, int mount_flags)
{
- auto custody = new Custody(parent, name, inode, mount_flags);
+ auto custody = adopt_ref_if_nonnull(new Custody(parent, name, inode, mount_flags));
if (!custody)
return ENOMEM;
- return adopt_ref(*custody);
+ return custody.release_nonnull();
}
~Custody();