fix: fixed segfault caused by invalid read

NULL value caused the error logger to crash
This commit is contained in:
2026-02-11 08:36:05 +01:00
parent c493979a18
commit 6b3d2ba5e0

View File

@@ -148,7 +148,7 @@ t_redirection *redirection_new(
if (*tokens == NULL)
{
free(redirection);
return (syntax_error_unexpected_token(NULL), NULL);
return (syntax_error_unexpected_token(token), NULL);
}
token = (t_token *)(*tokens)->content;
if (token->type != TOKEN_WORD)