diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-27 16:14:40 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-27 16:14:40 +0200 |
commit | abc749bfb38ce6c1cfb818bbc0da1cfbd0451bfe (patch) | |
tree | 091496cdf4a2c89cb6b30141fbbed8f1b3ab3403 /src/s_lpipes.c | |
parent | TODO update (diff) | |
download | 42-minishell-abc749bfb38ce6c1cfb818bbc0da1cfbd0451bfe.tar.gz 42-minishell-abc749bfb38ce6c1cfb818bbc0da1cfbd0451bfe.tar.bz2 42-minishell-abc749bfb38ce6c1cfb818bbc0da1cfbd0451bfe.tar.xz 42-minishell-abc749bfb38ce6c1cfb818bbc0da1cfbd0451bfe.tar.zst 42-minishell-abc749bfb38ce6c1cfb818bbc0da1cfbd0451bfe.zip |
Freed pipe leaks on builtins
Diffstat (limited to 'src/s_lpipes.c')
-rw-r--r-- | src/s_lpipes.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/s_lpipes.c b/src/s_lpipes.c index 9d10849..f6a6845 100644 --- a/src/s_lpipes.c +++ b/src/s_lpipes.c @@ -20,7 +20,7 @@ #include "s_struct.h" struct s_lpipes - *lpipes_last(struct s_lpipes *lpipes) + *s_lpipes_last(struct s_lpipes *lpipes) { while (lpipes->next != NULL) lpipes = lpipes->next; @@ -28,7 +28,7 @@ struct s_lpipes } void - lpipes_add_back(struct s_lpipes **alpipes, + s_lpipes_add_back(struct s_lpipes **alpipes, struct s_lpipes *new) { struct s_lpipes *tmp; @@ -37,13 +37,13 @@ void *alpipes = new; else { - tmp = lpipes_last(*alpipes); + tmp = s_lpipes_last(*alpipes); tmp->next = new; } } void - lpipes_clear(struct s_lpipes **lpipes) + s_lpipes_clear(struct s_lpipes **lpipes) { struct s_lpipes *tmp; struct s_lpipes *renext; @@ -62,12 +62,12 @@ void } struct s_lpipes - *lpipes_new(const char pipedword[], + *s_lpipes_new(const char pipedword[], t_msh *msh) { struct s_lpipes *link; - if (!(link = (struct s_lpipes*)malloc(sizeof(struct s_lpipes)))) + if ((link = (struct s_lpipes*)malloc(sizeof(struct s_lpipes))) == NULL) return (NULL); link->com = NULL; if ((link->com = s_com_new(pipedword, msh)) == NULL) @@ -79,7 +79,7 @@ struct s_lpipes } struct s_lpipes - *split_pipes(const char word[], + *s_split_pipes(const char word[], t_line *line, t_msh *msh) { @@ -92,11 +92,11 @@ struct s_lpipes i = 0; while (words[i]) { - if (!(lpipes = lpipes_new(words[i], msh))) + if (!(lpipes = s_lpipes_new(words[i], msh))) { return (NULL); } - lpipes_add_back(&line->pipes, lpipes); + s_lpipes_add_back(&line->pipes, lpipes); i++; } ft_delwords(words); |