-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstdelone_bonus.c
27 lines (24 loc) · 1.2 KB
/
ft_lstdelone_bonus.c
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
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_lstdelone.c :+: :+: */
/* +:+ */
/* By: jaberkro <[email protected]> +#+ */
/* +#+ */
/* Created: 2021/10/27 21:06:26 by jaberkro #+# #+# */
/* Updated: 2021/10/28 14:26:39 by jaberkro ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstdelone(t_list *lst, void (*del)(void*))
{
if (!lst || !del)
return ;
del(lst->content);
free(lst);
}
/* 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.
*/