diff options
author | irungentoo <irungentoo@gmail.com> | 2014-05-12 19:48:19 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-05-12 19:48:19 -0400 |
commit | 5b58da35f94884db535c5e54164d3771ef2c0bc7 (patch) | |
tree | 281d6dcec0ca218e987744306835cd3e89f3aef2 /toxcore/ping_array.c | |
parent | 53cc5ea6a9b31879443290993267da58f7404a85 (diff) |
Fixed segfault.
Diffstat (limited to 'toxcore/ping_array.c')
-rw-r--r-- | toxcore/ping_array.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
135 | if (size == 0 || timeout == 0 || empty_array == NULL) | 135 | if (size == 0 || timeout == 0 || empty_array == NULL) |
136 | return -1; | 136 | return -1; |
137 | 137 | ||
138 | empty_array->entries = malloc(size * sizeof(Ping_Array_Entry)); | 138 | empty_array->entries = calloc(size * sizeof(Ping_Array_Entry), 1); |
139 | 139 | ||
140 | if (empty_array->entries == NULL) | 140 | if (empty_array->entries == NULL) |
141 | return -1; | 141 | return -1; |