parsing: fix some easy leaks

This commit is contained in:
Khaïs COLIN 2025-04-14 17:13:29 +02:00
parent d40b6c3586
commit 0c489f25bb
2 changed files with 22 additions and 19 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/31 10:28:28 by jguelen #+# #+# */
/* Updated: 2025/04/14 15:10:28 by khais ### ########.fr */
/* Updated: 2025/04/14 17:18:21 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -173,7 +173,7 @@ t_cmd *minishell_simple_parse(t_minishell *app, t_wordlist *tokens)
t_redirect_add_back(&simple->value.simple->redirections, redir);
}
if (!simple->value.simple->words)
return (parse_error(app, tokens->word), NULL);
return (cmd_destroy(simple), parse_error(app, tokens->word), NULL);
return (simple);
}