rip leaks

This commit is contained in:
gwojda 2017-03-14 15:03:31 +01:00
parent 9ee6c10884
commit 864b8ec120

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 16:21:05 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_token *token;
t_list **head; t_list **head;
t_redir *redir; t_redir *redir;
char *tmp;
token = (*lst)->content; token = (*lst)->content;
if (token->type == HEREDOCDATA && data_singleton()->heredoc_queue != NULL) if (token->type == HEREDOCDATA && data_singleton()->heredoc_queue != NULL)
@ -34,8 +35,10 @@ int pop_heredoc(t_list **lst)
} }
else else
{ {
tmp = redir->heredoc_data;
redir->heredoc_data = ft_str3join(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); ft_lstdel(lst, &token_free);