diff --git a/data_structures/dynamic_array/dynamic_array.c b/data_structures/dynamic_array/dynamic_array.c index 7ecf359ccb..83e8c5ba32 100644 --- a/data_structures/dynamic_array/dynamic_array.c +++ b/data_structures/dynamic_array/dynamic_array.c @@ -17,7 +17,7 @@ void *add(dynamic_array_t *da, const void *value) if (da->size >= da->capacity) { void **newItems = - realloc(da->items, (da->capacity <<= 1) * sizeof(void **)); + realloc(da->items, (da->capacity <<= 1) * sizeof(void *)); free(da->items); da->items = newItems; @@ -79,4 +79,4 @@ void *retrive_copy_of_value(const void *value) memcpy(value_copy, value, sizeof(void *)); return value_copy; -} \ No newline at end of file +}