diff --git a/srcs/ft_print_strings.c b/srcs/ft_print_strings.c index 1b58a8e..7f9942f 100644 --- a/srcs/ft_print_strings.c +++ b/srcs/ft_print_strings.c @@ -35,11 +35,13 @@ t_dlist *get_first(void) void clean_list(void) { + t_dlist *tmp = list; while (list) { + tmp = list->previous; free(list->content); free(list); - list = list->previous; + list = tmp; } list = NULL; }