commit 7832db477bd9a48e84024fc5acb18a8d46198653
parent 56aeaaadfdd0876ff1e6b8121bda2015fde030bf
Author: klewer-martin <martin.cachari@gmail.com>
Date: Mon, 4 Jul 2022 21:24:17 -0300
Fix memory leak by Arr_destroy
The bug was caused because in the previous commit a new array was added
to Arr struct, in order to keep a copy of the random generated array, this was
dynamically allocated but never freed.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/array.c b/array.c
@@ -26,6 +26,7 @@ status_t Arr_create(Arr **arr) {
}
void Arr_destroy(Arr *arr) {
+ free(arr->bk);
free(arr->v);
free(arr);
}