Skip to content

Commit

Permalink
adding 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfosse committed Mar 24, 2017
1 parent 24854ed commit 351bcc2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 0x11-singly_linked_lists/4-free_list.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "lists.h"
/**
* free_list - frees all elements in a list_t list.
* @h: list to be freed.
* Return: NONE.
*/
void free_list(list_t *head)
{
list_t *copy;

for (; head != NULL; head = copy)
{
copy = head->next;
free(head->str);
free(head);
}
}
Binary file added 0x11-singly_linked_lists/e
Binary file not shown.

0 comments on commit 351bcc2

Please sign in to comment.