leak: resolve one memory leak

This commit is contained in:
Khaïs COLIN 2025-03-04 13:31:22 +01:00 committed by Khaïs COLIN
parent 5bf4bb8d6a
commit 69b247697c
2 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/24 17:49:46 by khais #+# #+# */
/* Updated: 2025/03/04 13:48:56 by khais ### ########.fr */
/* Updated: 2025/03/04 15:05:08 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -65,12 +65,12 @@ static void cmdlist_builder_delimit(
t_cmdlist_builder *builder,
t_wordlist **words)
{
wordlist_debug(builder->current_wordlist);
builder->cmdlist->pipelines[builder->idx]
= pipeline_from_wordlist(builder->current_wordlist);
if (builder->cmdlist->pipelines[builder->idx] == NULL)
{
cmdlist_builder_error(builder);
wordlist_destroy(*words);
return ;
}
if (cmdlist_builder_at_last_pipeline(builder))
@ -78,6 +78,7 @@ static void cmdlist_builder_delimit(
else
builder->cmdlist->operators[builder->idx]
= match_op(builder->current_word->word);
wordlist_destroy(builder->current_wordlist);
builder->current_wordlist = NULL;
worddesc_destroy(builder->current_word);
builder->current_word = wordlist_pop(words);