From: Jérôme Benoit Date: Tue, 28 Feb 2017 14:55:17 +0000 (+0100) Subject: TP_8 exo3: Fix the linked list freeing function to properly go to the next link. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0c2d94f5a32e95d2117d9204dbdd79d878c23b69;p=TD_C.git TP_8 exo3: Fix the linked list freeing function to properly go to the next link. Signed-off-by: Jérôme Benoit --- 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; }