From f177c35b51233c901d73c32595e64ab0264ba223 Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Sun, 9 Apr 2023 19:58:36 +0200 Subject: [PATCH] fix invalid read --- srcs/ft_print_strings.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }