Use the real size of res

This commit is contained in:
Jacob Adams 2015-03-18 09:11:18 -04:00
parent 09614bba41
commit 75a7082c90

View File

@ -66,14 +66,14 @@ main(int argc, char * argv[])
goto Usage; goto Usage;
} }
} }
size_t ressize = arg * sizeof(swifi_result_t);
res = malloc(arg * sizeof(swifi_result_t)); res = malloc(ressize);
if (res == NULL) { if (res == NULL) {
printf("Out of memory\n"); printf("Out of memory\n");
goto Cleanup; goto Cleanup;
} }
memset(res, 0, sizeof(*res)); memset(res, 0, sizeof(ressize));
/* /*
// Find out where the faults will be injected // Find out where the faults will be injected