From 5dd62128f45af0315965ab9a9cd734fc8fe73481 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 28 Feb 2017 15:53:17 +0100 Subject: [PATCH] TP_9 exo1: Fix the linked list freeing function to properly go to the next link. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TP_9/exo1/clist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP_9/exo1/clist.c b/TP_9/exo1/clist.c index 69fd8cc..87f97a7 100644 --- a/TP_9/exo1/clist.c +++ b/TP_9/exo1/clist.c @@ -44,7 +44,7 @@ int list_get(link_t* head, unsigned index) { void list_clear(link_t* link) { while (link != NULL) { - link_t* next_link = link; + link_t* next_link = link->next; free(link); link = next_link; } -- 2.34.1