From bef2cebdde5c7ff5c07622867f545ab5291d3e3c 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..3b0c586 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; free(list->content); free(list); - list = list->previous; + list = tmp->previous; } list = NULL; }