mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
fix(simple_cmd): did not free redirection list correctly
This commit is contained in:
parent
0584757446
commit
c258fa6077
3 changed files with 6 additions and 4 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/21 12:30:07 by khais #+# #+# */
|
||||
/* Updated: 2025/03/19 14:28:36 by khais ### ########.fr */
|
||||
/* Updated: 2025/03/19 16:49:12 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -36,6 +36,7 @@ void simple_cmd_destroy(t_simple_cmd *cmd)
|
|||
if (cmd == NULL)
|
||||
return ;
|
||||
wordlist_destroy(cmd->words);
|
||||
redir_list_destroy(cmd->redirections);
|
||||
free(cmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/07 14:29:53 by khais #+# #+# */
|
||||
/* Updated: 2025/03/20 11:38:46 by khais ### ########.fr */
|
||||
/* Updated: 2025/03/20 11:39:41 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ static t_redir_list *redir_list_create(t_redirection *item)
|
|||
/*
|
||||
** free all memory associated with this redir list
|
||||
*/
|
||||
static void redir_list_destroy(t_redir_list *lst)
|
||||
void redir_list_destroy(t_redir_list *lst)
|
||||
{
|
||||
t_redir_list *prev;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/07 14:29:32 by khais #+# #+# */
|
||||
/* Updated: 2025/03/19 12:10:54 by khais ### ########.fr */
|
||||
/* Updated: 2025/03/19 16:49:52 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -24,6 +24,7 @@ typedef struct s_redirection_list
|
|||
} t_redir_list;
|
||||
|
||||
t_redir_list *redir_list_push(t_redir_list *lst, t_redirection *item);
|
||||
void redir_list_destroy(t_redir_list *lst);
|
||||
void redir_list_debug(t_redir_list *lst,
|
||||
t_buffer *leader, bool is_last);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue