diff --git a/ccc.c b/ccc.c index 289fd85..e9a551c 100644 --- a/ccc.c +++ b/ccc.c @@ -459,9 +459,8 @@ void cleanup(void) if (files->length != 0) { arraylist_free(files); } - if (marked->length != 0) { - arraylist_free(marked); - } + free(marked->items); + free(marked); /* Restore old terminal settings */ tcsetattr(STDIN_FILENO, TCSAFLUSH, &oldt); bprintf("\033[2J\033[?1049l\033[?25h"); diff --git a/file.c b/file.c index 07601a6..4846155 100644 --- a/file.c +++ b/file.c @@ -16,7 +16,6 @@ ArrayList *arraylist_init(size_t capacity) void arraylist_free(ArrayList *list) { - /* for (size_t i = 0; i < list->length; i++) { if (list->items[i].name != NULL) free(list->items[i].name); @@ -25,7 +24,6 @@ void arraylist_free(ArrayList *list) if (list->items[i].stats != NULL) free(list->items[i].stats); } - */ free(list->items); free(list); }