diff options
| author | Dominik Kaiser | 2025-01-25 14:42:46 +0100 |
|---|---|---|
| committer | Dominik Kaiser | 2025-01-25 14:42:46 +0100 |
| commit | b427100b6c0c655f74dc689533a3f36edfeebffc (patch) | |
| tree | f2cca636434cda8e0f9acaa526c4a71e6444b2bc /src/execute_cmd.c | |
| parent | 87b90103930d83d74baa998866b0995cb8887d51 (diff) | |
| download | minishell-b427100b6c0c655f74dc689533a3f36edfeebffc.tar.gz minishell-b427100b6c0c655f74dc689533a3f36edfeebffc.zip | |
Fix last leak
Diffstat (limited to 'src/execute_cmd.c')
| -rw-r--r-- | src/execute_cmd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/execute_cmd.c b/src/execute_cmd.c index 9f00522..adfcb37 100644 --- a/src/execute_cmd.c +++ b/src/execute_cmd.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/12/17 19:21:35 by chuhlig #+# #+# */ -/* Updated: 2025/01/25 11:41:42 by chuhlig ### ########.fr */ +/* Updated: 2025/01/25 14:42:39 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -49,6 +49,8 @@ int execute_cmd(t_cmd *cmd, t_env **env) int original_std[2]; int result; + if (cmd->args == NULL || cmd->args[0] == NULL) + return (EXIT_FAILURE); original_std[1] = dup(STDOUT_FILENO); original_std[0] = dup(STDIN_FILENO); create_files(cmd->create_files); |
