From 5b58da35f94884db535c5e54164d3771ef2c0bc7 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 12 May 2014 19:48:19 -0400 Subject: [PATCH] Fixed segfault. --- 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 cb18ceb3..e6f684ef 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 = malloc(size * sizeof(Ping_Array_Entry)); + empty_array->entries = calloc(size * sizeof(Ping_Array_Entry), 1); if (empty_array->entries == NULL) return -1;