-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstdelone.c
More file actions
33 lines (30 loc) · 1.24 KB
/
ft_lstdelone.c
File metadata and controls
33 lines (30 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_lstdelone.c :+: :+: */
/* +:+ */
/* By: farodrig <farodrig@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/12/13 21:08:59 by farodrig #+# #+# */
/* Updated: 2021/01/25 11:55:22 by farodrig ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
/*
** Takes as a parameter an element and frees the memory of the element's
** content using the function 'del' given as a parameter and free the element.
** The memory of 'next' must not be freed
*/
void ft_lstdelone(t_list *list, void (*del)(void*))
{
if (!list)
{
return ;
}
if (del)
{
del(list->content);
}
free(list);
}