From a13bc5e70c097c1c0a02b25c86a603d9b400f3ec Mon Sep 17 00:00:00 2001 From: kyle condon Date: Sun, 6 Jul 2014 09:55:46 +0100 Subject: [PATCH] Update ping_array.c Change calloc call on line 138 from empty_array->entries = calloc(size * sizeof(Ping_Array_Entry), 1);, to empty_array->entries = calloc(size, sizeof(Ping_Array_Entry)); --- toxcore/ping_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/ping_array.c b/toxcore/ping_array.c index 5c92527e..93dade05 100644 --- a/toxcore/ping_array.c +++ b/toxcore/ping_array.c @@ -135,7 +135,7 @@ int ping_array_init(Ping_Array *empty_array, uint32_t size, uint32_t timeout) if (size == 0 || timeout == 0 || empty_array == NULL) return -1; - empty_array->entries = calloc(size * sizeof(Ping_Array_Entry), 1); + empty_array->entries = calloc(size, sizeof(Ping_Array_Entry)); if (empty_array->entries == NULL) return -1;