From: Lukas Jiriste Date: Tue, 5 Mar 2024 11:47:08 +0000 (+0100) Subject: Make checker free memory of get_next_line on error X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=23051026123bbfafe8cf785a67ce447aec835599;p=42%2Fpush_swap.git Make checker free memory of get_next_line on error Without this get_next_line frees its memory on EOF, but when invalid command is entered, EOF never comes. --- diff --git a/src/checker.c b/src/checker.c index eff49a5..3ed7d16 100644 --- a/src/checker.c +++ b/src/checker.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/24 10:31:06 by ljiriste #+# #+# */ -/* Updated: 2024/03/05 09:40:36 by ljiriste ### ########.fr */ +/* Updated: 2024/03/05 12:46:19 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -75,6 +75,7 @@ static int interpret(t_stacks *s) if (command_parse(input, &command)) { free(input); + get_next_line(-1); return (1); } execute(command, s);