Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix memory allocation success check
Browse files Browse the repository at this point in the history
  • Loading branch information
bgawrych committed Aug 10, 2020
1 parent af1aaba commit 711b9f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ inline int GetDefaultDtype(int dtype) {
inline bool AlignedMemAlloc(void** ptr, size_t size, size_t alignment) {
#if _MSC_VER
*ptr = _aligned_malloc(size, alignment);
if(ptr == nullptr)
if(*ptr == nullptr)
return false;
#else
int res = posix_memalign(ptr, alignment, size);
Expand Down

0 comments on commit 711b9f6

Please sign in to comment.