mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
redirection parsing: add missing null check
This commit is contained in:
parent
b0439c9d7d
commit
e7946b4192
1 changed files with 2 additions and 0 deletions
|
|
@ -36,6 +36,8 @@ struct s_simple_cmd *parse_redirections(struct s_simple_cmd *cmd)
|
|||
worddesc_destroy(wordlist_pop(&cmd->words));
|
||||
marker = wordlist_pop(&cmd->words);
|
||||
redirection = redirection_create(REDIR_OUTPUT, marker);
|
||||
if (redirection == NULL)
|
||||
return (NULL);
|
||||
cmd->redirections = redir_list_push(cmd->redirections, redirection);
|
||||
if (cmd->redirections == NULL)
|
||||
return (redirection_destroy(redirection), NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue