From cb1423079805f4f229782197f510a3138fbe1ee6 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 22 Oct 2020 20:06:42 +0200 Subject: normed --- src/m_loop.c | 6 ++---- src/s_com.c | 2 ++ src/s_lpipes.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/m_loop.c b/src/m_loop.c index a2cf621..732c005 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -54,10 +54,8 @@ static void m_parse_and_run_line(char line[], uint8_t previf, t_msh *msh) continue ; } e_line_block(msh); - if (msh->com != NULL) - s_com_destroy(&msh->com); - if (msh->pipes != NULL) - s_lpipes_clear(&msh->pipes); + s_com_destroy(&msh->com); + s_lpipes_clear(&msh->pipes); } previf = ptr->nextif; ptr = ptr->next; diff --git a/src/s_com.c b/src/s_com.c index 7ed20bc..14dc4ef 100644 --- a/src/s_com.c +++ b/src/s_com.c @@ -81,6 +81,8 @@ void s_com_destroy(t_com **com) { t_com *ptr; + if (*com == NULL) + return ; ptr = *com; ft_memdel((void*)&ptr->bin); if (ptr->argv != NULL) diff --git a/src/s_lpipes.c b/src/s_lpipes.c index 22ed2a5..0f0529a 100644 --- a/src/s_lpipes.c +++ b/src/s_lpipes.c @@ -34,7 +34,7 @@ struct s_lpipes *s_lpipes_last(struct s_lpipes *lpipes) } void s_lpipes_add_back(struct s_lpipes **alpipes, - struct s_lpipes *new) + struct s_lpipes *new) { struct s_lpipes *tmp; -- cgit v1.2.3