swifi: Fix incorrect memset

Change-Id: I6764aff558f51cdb90b91a3e71c982e8b3f47058
This commit is contained in:
Jacob Adams 2015-03-18 09:04:01 -04:00 committed by Lionel Sambuc
parent 056ece2898
commit 80c94e3974

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, ressize);
/* /*
// Find out where the faults will be injected // Find out where the faults will be injected