-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_free.c
43 lines (38 loc) · 1.26 KB
/
list_free.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* list_free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: almelo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/25 16:07:13 by almelo #+# #+# */
/* Updated: 2023/03/10 12:30:46 by almelo ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void free_env_list(t_envl *env_lst)
{
t_env *head;
t_env *tmp;
head = env_lst->head;
while (head)
{
tmp = head->next;
free(head->key);
free(head->value);
free(head);
head = tmp;
}
}
void free_token_list(t_tokenl *token_lst)
{
t_token *head;
t_token *tmp;
head = token_lst->head;
while (head)
{
tmp = head->next;
free(head);
head = tmp;
}
}