final finish on the parsing protecting the malloc

This commit is contained in:
Maoake Teriierooiterai committed 2026-01-09 07:21:50 +01:00
1 parent 0df082065e
commit 32a0668b62
3 files changed
+31 -11

No files matched your search

+10
View File
@@ -64,6 +64,11 @@ static t_stack *special_parsing(char **argv, int mod)
return (NULL);
len = len_split(split_tab);
a = parsing(len, split_tab, mod);
if (!a)
{
free_tab(split_tab);
return (NULL);
}
free_tab(split_tab);
return (a);
}
@@ -101,6 +106,11 @@ t_stacks *init_piles(int argc, char **argv, int mod)
a = parsing(argc, argv, mod);
else
a = special_parsing(argv, mod);
if (!a)
{
free(stacks);
return (NULL);
}
stacks->a = a;
return (stacks);
}