[FIX] bad malloc size in execute_command

This commit is contained in:
mcolonna 2024-05-15 12:05:44 +02:00
parent e531a5917d
commit 3adace7f33

View file

@ -6,7 +6,7 @@
/* By: jschaft <cecile.schaft@orange.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 13:48:00 by jschaft #+# #+# */
/* Updated: 2024/05/13 10:17:48 by jschaft ### ########.fr */
/* Updated: 2024/05/15 12:04:07 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
@ -77,7 +77,7 @@ int execute_command(t_memclass mc, t_command command, char *const envp[])
i = 0;
while (command.calls[i].program != NULL)
i++;
pipes = malloc(sizeof(t_pipes) * i + 1);
pipes = malloc(sizeof(t_pipes) * (i + 1));
i = 0;
while (command.calls[i].program != NULL)
{