Skip to content

Commit dc6156e

Browse files
committed
4-free_listint.c
1 parent 4061db2 commit dc6156e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "lists.h"
2+
3+
/**
4+
* free_listint - free a linked list
5+
* @head: pointer to head of the list
6+
*/
7+
8+
void free_listint(listint_t *head)
9+
{
10+
listint_t *tmp;
11+
12+
while (head)
13+
{
14+
tmp = head->next;
15+
free(head);
16+
head = tmp;
17+
}
18+
}

0 commit comments

Comments
 (0)