From 864b8ec120cbff15343b1ffa2f35623429e643dd Mon Sep 17 00:00:00 2001 From: gwojda Date: Tue, 14 Mar 2017 15:03:31 +0100 Subject: [PATCH] rip leaks --- 42sh/src/parser/heredoc_parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/42sh/src/parser/heredoc_parser.c b/42sh/src/parser/heredoc_parser.c index 54a837c7..78a74e01 100644 --- a/42sh/src/parser/heredoc_parser.c +++ b/42sh/src/parser/heredoc_parser.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 16:21:05 by ariard #+# #+# */ -/* Updated: 2017/03/13 19:28:21 by ariard ### ########.fr */ +/* Updated: 2017/03/14 15:02:34 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,6 +17,7 @@ int pop_heredoc(t_list **lst) t_token *token; t_list **head; t_redir *redir; + char *tmp; token = (*lst)->content; if (token->type == HEREDOCDATA && data_singleton()->heredoc_queue != NULL) @@ -34,8 +35,10 @@ int pop_heredoc(t_list **lst) } else { + tmp = redir->heredoc_data; redir->heredoc_data = ft_str3join(redir->heredoc_data, - (char*)token->data, "\n"); + (char*)token->data, "\n"); + ft_strdel(&tmp); } } ft_lstdel(lst, &token_free);