diff --git a/kernel/src/fs/tmpfs/FileSystem.cpp b/kernel/src/fs/tmpfs/FileSystem.cpp index 772433cc..b0f2df99 100644 --- a/kernel/src/fs/tmpfs/FileSystem.cpp +++ b/kernel/src/fs/tmpfs/FileSystem.cpp @@ -7,7 +7,7 @@ namespace TmpFS { Result> FileSystem::create() { - SharedPtr fs = TRY(adopt_shared(new (std::nothrow) FileSystem())); + SharedPtr fs = TRY(adopt_shared_if_nonnull(new (std::nothrow) FileSystem())); SharedPtr root = TRY(fs->create_dir_inode({})); fs->set_root(root); return (SharedPtr)fs;