fix: leak fd

This commit is contained in:
Camille Chauvet 2023-03-31 18:48:19 +02:00
parent a7e75bb163
commit f6617e07c7

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/17 15:36:26 by cchauvet #+# #+# */ /* Created: 2023/02/17 15:36:26 by cchauvet #+# #+# */
/* Updated: 2023/03/31 16:19:48 by alouis-j ### ########.fr */ /* Updated: 2023/03/31 18:48:02 by alouis-j ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -73,12 +73,11 @@ int ft_heredoc(t_data *data, char *stop)
break ; break ;
else if (return_code) else if (return_code)
{ {
*ft_get_heredoc() = -1;
close(*ft_get_heredoc()); close(*ft_get_heredoc());
*ft_get_heredoc() = -1;
return (-2); return (-2);
} }
} }
close(*ft_get_heredoc());
*ft_get_heredoc() = -1; *ft_get_heredoc() = -1;
*ft_get_heredoc() = -1; *ft_get_heredoc() = -1;
close(fds[1]); close(fds[1]);