From 3adace7f330d6b2f48c40ead45f5f16ca9fd4fcf Mon Sep 17 00:00:00 2001 From: mcolonna Date: Wed, 15 May 2024 12:05:44 +0200 Subject: [PATCH] [FIX] bad malloc size in execute_command --- src/exec_command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exec_command.c b/src/exec_command.c index d431226..ee7823f 100644 --- a/src/exec_command.c +++ b/src/exec_command.c @@ -6,7 +6,7 @@ /* By: jschaft +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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) {