leaks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -35,6 +35,7 @@ void exec_pchild(int *pipes, int index, t_ast_n *pcmd, int cmds)
|
||||
ret = 0;
|
||||
if (index < cmds - 1)
|
||||
dup2(pipes[1], STDOUT_FILENO);
|
||||
close(pcmd->msh->hist);
|
||||
close(pipes[0]);
|
||||
close(pipes[1]);
|
||||
handle_redir(pcmd);
|
||||
|
||||
@@ -52,6 +52,8 @@ void free_msh(t_msh *msh)
|
||||
free_tab(msh->env);
|
||||
if (msh->hist != -1)
|
||||
close(msh->hist);
|
||||
if (msh->here_fd != -1)
|
||||
close(msh->here_fd);
|
||||
free(msh->input);
|
||||
free(msh);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user