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