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