This commit is contained in:
Loic Deridder
2025-02-12 15:53:22 +01:00
parent e6ef9f494b
commit e60a03293e
3 changed files with 4 additions and 1 deletions

View File

@@ -1 +1 @@
make && valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all --suppressions=valgrind.supp -s ./minishell make && valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all --trace-children=yes --track-fds=all --suppressions=valgrind.supp -s ./minishell

View File

@@ -35,6 +35,7 @@ void exec_pchild(int *pipes, int index, t_ast_n *pcmd, int cmds)
ret = 0; ret = 0;
if (index < cmds - 1) if (index < cmds - 1)
dup2(pipes[1], STDOUT_FILENO); dup2(pipes[1], STDOUT_FILENO);
close(pcmd->msh->hist);
close(pipes[0]); close(pipes[0]);
close(pipes[1]); close(pipes[1]);
handle_redir(pcmd); handle_redir(pcmd);

View File

@@ -52,6 +52,8 @@ void free_msh(t_msh *msh)
free_tab(msh->env); free_tab(msh->env);
if (msh->hist != -1) if (msh->hist != -1)
close(msh->hist); close(msh->hist);
if (msh->here_fd != -1)
close(msh->here_fd);
free(msh->input); free(msh->input);
free(msh); free(msh);
} }