summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/m_loop.c6
-rw-r--r--src/s_com.c2
-rw-r--r--src/s_lpipes.c2
3 files changed, 5 insertions, 5 deletions
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;