From 23051026123bbfafe8cf785a67ce447aec835599 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Tue, 5 Mar 2024 12:47:08 +0100 Subject: [PATCH] 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. --- src/checker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.30.2