diff --git a/src/parser/parser.c b/src/parser/parser.c index 993a011..81a3082 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -6,7 +6,7 @@ /* By: sede-san type != TOKEN_WORD) { free(redirection); + while (*tokens != NULL) + *tokens = (*tokens)->next; return (syntax_error_unexpected_token(token), NULL); } redirection->target = ft_strdup(token->value);