From 0c2d94f5a32e95d2117d9204dbdd79d878c23b69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 28 Feb 2017 15:55:17 +0100 Subject: [PATCH] TP_8 exo3: 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_8/exo3/exo3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP_8/exo3/exo3.c b/TP_8/exo3/exo3.c index 2c433a5..6f9cb34 100644 --- a/TP_8/exo3/exo3.c +++ b/TP_8/exo3/exo3.c @@ -57,7 +57,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