posixfile.cpp: nothrow is passed to operator new, not to reinterpret_cast.

This commit is contained in:
Vas Crabb 2025-03-05 03:14:46 +11:00
parent c36ff69f33
commit 493348cd58

View File

@ -380,7 +380,7 @@ std::unique_ptr<osd::directory::entry> osd_stat(const std::string &path)
// create an osd_directory_entry; be sure to make sure that the caller can
// free all resources by just freeing the resulting osd_directory_entry
auto const result = reinterpret_cast<osd::directory::entry *>(::operator new(sizeof(osd::directory::entry) + path.length() + 1), std::nothrow);
auto const result = reinterpret_cast<osd::directory::entry *>(::operator new(sizeof(osd::directory::entry) + path.length() + 1, std::nothrow));
if (!result) return nullptr;
new (result) osd::directory::entry;