Browse Source

[fix] mallocation was only done for cmds and not for 'NULL'.

Moul 2 years ago
parent
commit
b40f60c96f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/pipe_exec.c

+ 1 - 1
src/pipe_exec.c

@@ -9,7 +9,7 @@
 void	launch_pipes(t_e *e, t_pipe *p, t_pr **t)
 {
 	p->i = -1;
-	p->cmd_opt = (char***)malloc(sizeof(char**) * (p->nbr + 1));
+	p->cmd_opt = (char***)malloc(sizeof(char**) * (p->nbr + 2));
 	while (++p->i <= p->pnbr)
 	{
 		if (t[p->i]->itxt != NULL)