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));
This commit is contained in:
kyle condon 2014-07-06 09:55:46 +01:00
parent 04b1b2cfd4
commit a13bc5e70c

View File

@ -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;