Check a memory allocatin

This commit is contained in:
Guilhem Lavaux 2023-12-06 08:10:27 +01:00
parent 5892ce7738
commit 2e21bd9dfb

View file

@ -286,6 +286,10 @@ int main(int argc, char *argv[]) {
/* Now calculate volumes*/ /* Now calculate volumes*/
printf("Now finding volumes ...\n"); fflush(stdout); printf("Now finding volumes ...\n"); fflush(stdout);
vols = (float *)malloc(nvp*sizeof(float)); vols = (float *)malloc(nvp*sizeof(float));
if (vols == NULL) {
printf("Unable to allocate vols\n");
exit(0);
}
for (i=0; i<nvp; i++) { /* Just the original particles for (i=0; i<nvp; i++) { /* Just the original particles
Assign adjacency coordinate array*/ Assign adjacency coordinate array*/