avoid 32-bit integer overflow when allocating memory for neighbor list copy
This commit is contained in:
@ -62,8 +62,7 @@ void *Memory::smalloc(bigint nbytes, const char *name)
|
||||
void *ptr = malloc(nbytes);
|
||||
#endif
|
||||
if (ptr == nullptr)
|
||||
error->one(FLERR,"Failed to allocate {} bytes for array {}",
|
||||
nbytes,name);
|
||||
error->one(FLERR,"Failed to allocate {} bytes for array {}", nbytes,name);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user