🔨」 fix: No more leak in the parsing

This commit is contained in:
2024-07-09 16:19:19 +02:00
parent 91a78d5870
commit c935f80dfe
4 changed files with 9 additions and 6 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/30 10:48:41 by adjoly #+# #+# */
/* Updated: 2024/07/07 14:57:54 by adjoly ### ########.fr */
/* Updated: 2024/07/09 16:16:27 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -23,6 +23,7 @@ t_cmd *get_redir_fd(void *content, t_env *env)
t_list *tmp;
t_redir_sign sign[2];
t_cmd *cmd;
char *env_varred;
tmp = ((t_token *)content)->redirection;
cmd = NULL;
@ -38,6 +39,8 @@ t_cmd *get_redir_fd(void *content, t_env *env)
cmd->outfile = STDOUT_FILENO;
if (sign[1] == OUTFILE)
cmd->infile = STDIN_FILENO;
cmd = split_cmd(env_var_replace(((t_token *)content)->argv, env), cmd);
env_varred = env_var_replace(((t_token *)content)->argv, env);
cmd = split_cmd(env_varred, cmd);
free(env_varred);
return (cmd);
}