From 6b200dc03c8233f6cd49111540002eb9b5aac4ec Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 9 Oct 2020 11:20:47 +0200 Subject: Fixing 2 leaks in get_next_line and parser --- src/parser/parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/parser/parser.c') diff --git a/src/parser/parser.c b/src/parser/parser.c index ce4501c..e861232 100644 --- a/src/parser/parser.c +++ b/src/parser/parser.c @@ -6,7 +6,7 @@ /* By: nahaddac +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/06/17 18:09:04 by nahaddac #+# #+# */ -/* Updated: 2020/10/08 17:42:53 by cacharle ### ########.fr */ +/* Updated: 2020/10/09 11:10:55 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -154,6 +154,9 @@ t_parsed *parse_op(t_tok_lst *input) sep_tag = input->tag; if (!(sep_tag & TAG_IS_SEP)) { + ast_destroy(left->ast); + tok_lst_destroy(&left->rest, free); + free(left); return (parsed_error("syntax error near unexpected token `%s'", g_sep_str_lookup[sep_tag])); } -- cgit