summaryrefslogtreecommitdiffstats
path: root/src/ft_p_lcom_next.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 18:19:52 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 18:19:52 +0200
commit16490a5e3d03b8fa75746c874c3c3855e6ce11b9 (patch)
tree1ce152e29ee05ad7e040bdd3fca924e1d4a9327e /src/ft_p_lcom_next.c
parentBug fix (diff)
download42-minishell-16490a5e3d03b8fa75746c874c3c3855e6ce11b9.tar.gz
42-minishell-16490a5e3d03b8fa75746c874c3c3855e6ce11b9.tar.bz2
42-minishell-16490a5e3d03b8fa75746c874c3c3855e6ce11b9.tar.xz
42-minishell-16490a5e3d03b8fa75746c874c3c3855e6ce11b9.tar.zst
42-minishell-16490a5e3d03b8fa75746c874c3c3855e6ce11b9.zip
k
Diffstat (limited to 'src/ft_p_lcom_next.c')
-rw-r--r--src/ft_p_lcom_next.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ft_p_lcom_next.c b/src/ft_p_lcom_next.c
index 626bf50..df312bc 100644
--- a/src/ft_p_lcom_next.c
+++ b/src/ft_p_lcom_next.c
@@ -18,6 +18,7 @@ char
**ft_subst_args(const char word[],
int8_t redir)
{
+ /* TODO: norme */
char **words;
char *subst;
size_t i;
@@ -39,7 +40,10 @@ char
if (!(subst = ft_substr(word, 0, i)))
return (NULL);
if (!(words = ft_split(subst, ' ')))
+ {
+ ft_memdel((void*)&subst);
return (NULL);
+ }
ft_memdel((void*)&subst);
return (words);
}