-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_free3.c
46 lines (40 loc) · 1.43 KB
/
ft_free3.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
44
45
46
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_free3.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jsolinis <jsolinis@student.42urduliz.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/14 12:12:43 by jsolinis #+# #+# */
/* Updated: 2022/04/14 13:02:16 by jsolinis ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void ft_free_args_red(t_proc *proc)
{
int row;
row = -1;
while ((*proc->lst)->args_red && (*proc->lst)->args_red[++row])
{
if ((*proc->lst)->has_red)
free((*proc->lst)->args_red[row]);
}
if ((*proc->lst)->args_red)
free((*proc->lst)->args_red);
}
void ft_free_args(t_proc *proc)
{
int row;
row = -1;
while ((*proc->lst)->args[++row])
{
if ((*proc->lst)->args[row])
free((*proc->lst)->args[row]);
}
if ((*proc->lst)->args)
free((*proc->lst)->args);
}
void ft_free_node_routes(t_proc *proc)
{
free((*proc->lst)->route);
}