-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstdelone.c
More file actions
31 lines (28 loc) · 1.25 KB
/
ft_lstdelone.c
File metadata and controls
31 lines (28 loc) · 1.25 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstdelone.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: antandre <antandre@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/26 13:14:30 by antandre #+# #+# */
/* Updated: 2024/06/26 14:02:03 by antandre ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
/*
* Takes an 'lst' node as a parameter and releases the
* memory of the content using the 'del' function given as a parameter,
* in addition to releasing the node. The 'next' memory should not be freed.
*/
void ft_lstdelone(t_list *lst, void (*del)(void *))
{
if (!lst || !del)
return ;
if (lst)
{
del(lst->content);
free(lst);
}
}