Common: unused-result warning fix

This commit is contained in:
Stenzek 2023-09-05 22:58:11 +10:00
parent 56d95c3331
commit fc96c2f656
1 changed files with 1 additions and 2 deletions

View File

@ -72,8 +72,7 @@ ALWAYS_INLINE static void* AlignedMalloc(size_t size, size_t alignment)
size = (size + alignment - 1) & ~(alignment - 1);
#endif
void* ret = nullptr;
posix_memalign(&ret, alignment, size);
return ret;
return (posix_memalign(&ret, alignment, size) == 0) ? ret : nullptr;
#endif
}