aboutsummaryrefslogtreecommitdiff
path: root/src/parser/parser.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-09 11:20:47 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-09 11:20:47 +0200
commit6b200dc03c8233f6cd49111540002eb9b5aac4ec (patch)
tree5834002464dfbf03ee0d9fd6faea05fa37f8397f /src/parser/parser.c
parent97e7e9b9934f99fbc659445512b19a525802726c (diff)
downloadminishell-6b200dc03c8233f6cd49111540002eb9b5aac4ec.tar.gz
minishell-6b200dc03c8233f6cd49111540002eb9b5aac4ec.tar.bz2
minishell-6b200dc03c8233f6cd49111540002eb9b5aac4ec.zip
Fixing 2 leaks in get_next_line and parser
Diffstat (limited to 'src/parser/parser.c')
-rw-r--r--src/parser/parser.c5
1 files changed, 4 insertions, 1 deletions
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 <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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]));
}