mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed segfault.
This commit is contained in:
parent
53cc5ea6a9
commit
5b58da35f9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user