From 75a7082c90086c55e5aaf596b940cf17c59bd990 Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Wed, 18 Mar 2015 09:11:18 -0400 Subject: [PATCH] Use the real size of res --- minix/commands/swifi/systest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minix/commands/swifi/systest.c b/minix/commands/swifi/systest.c index f75f49f48..f45967228 100644 --- a/minix/commands/swifi/systest.c +++ b/minix/commands/swifi/systest.c @@ -66,14 +66,14 @@ main(int argc, char * argv[]) goto Usage; } } - - res = malloc(arg * sizeof(swifi_result_t)); + size_t ressize = arg * sizeof(swifi_result_t); + res = malloc(ressize); if (res == NULL) { printf("Out of memory\n"); goto Cleanup; } - memset(res, 0, sizeof(*res)); + memset(res, 0, sizeof(ressize)); /* // Find out where the faults will be injected