Resolving the leaks problemes of the path good luck maiboyer
This commit is contained in:
parent
56655f5426
commit
dffb6ea577
3 changed files with 21 additions and 20 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/29 11:35:51 by rparodi #+# #+# */
|
||||
/* Updated: 2024/04/01 01:16:47 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/04/01 18:21:22 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -25,21 +25,22 @@ void ft_free_strs(t_str *strs)
|
|||
free(strs);
|
||||
}
|
||||
|
||||
t_str str_input;
|
||||
t_str *strs_input;
|
||||
|
||||
void ft_free_utils(t_utils *s)
|
||||
{
|
||||
if (s->name_shell)
|
||||
free(s->name_shell);
|
||||
if (s->str_input)
|
||||
free(str_input);
|
||||
free(s->str_input);
|
||||
if (s->strs_input)
|
||||
ft_free_strs(strs_input);
|
||||
ft_free_strs(s->strs_input);
|
||||
if (s->path)
|
||||
ft_free_strs(s->path);
|
||||
free(s);
|
||||
}
|
||||
|
||||
void ft_exit(t_utils *maiboyerlpb, t_u8 exit_status)
|
||||
{
|
||||
if (maiboyerlpb)
|
||||
if (maiboyerlpb != NULL)
|
||||
ft_free_utils(maiboyerlpb);
|
||||
printf("exit\n");
|
||||
exit(exit_status);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue