Fix bug causing the program to probably go off and free NULL.
This commit is contained in:
parent
75ff581de3
commit
a4d41361dd
2
src/ll.c
2
src/ll.c
|
@ -116,7 +116,7 @@ void* ll_poptail(ll* ll) {
|
||||||
|
|
||||||
void ll_clear(ll* ll){
|
void ll_clear(ll* ll){
|
||||||
ll_node* head = ll->head;
|
ll_node* head = ll->head;
|
||||||
while(ll->head){
|
while(head){
|
||||||
ll_node* to_free = head;
|
ll_node* to_free = head;
|
||||||
head = head->next;
|
head = head->next;
|
||||||
free(to_free);
|
free(to_free);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user