From a4d41361ddda8111a2ae4f7acba97793b02f0551 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 26 Dec 2016 00:32:51 -0800 Subject: [PATCH] Fix bug causing the program to probably go off and free NULL. --- src/ll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ll.c b/src/ll.c index 599ec30..08a4b3c 100644 --- a/src/ll.c +++ b/src/ll.c @@ -116,7 +116,7 @@ void* ll_poptail(ll* ll) { void ll_clear(ll* ll){ ll_node* head = ll->head; - while(ll->head){ + while(head){ ll_node* to_free = head; head = head->next; free(to_free);