aboutsummaryrefslogtreecommitdiff
path: root/src/error.c
diff options
context:
space:
mode:
authorDominik Kaiser2025-01-25 15:58:12 +0100
committerGitHub2025-01-25 15:58:12 +0100
commit3b97eaa0500314866c4a106c77e8f671c9751b89 (patch)
treef44fffea0ef290f9bdf79448c90d794ba97b8ca4 /src/error.c
parentbd8c817797d5f2b1affe6957ffc51846a38e70ec (diff)
parent8fb5e2839cb7eb7bb72f577577afafcdbdc8a714 (diff)
downloadminishell-3b97eaa0500314866c4a106c77e8f671c9751b89.tar.gz
minishell-3b97eaa0500314866c4a106c77e8f671c9751b89.zip
Merge memory leak fixes
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/error.c b/src/error.c
index 2ca60b2..eebc21a 100644
--- a/src/error.c
+++ b/src/error.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/15 16:35:53 by dkaiser #+# #+# */
-/* Updated: 2025/01/20 18:12:40 by dkaiser ### ########.fr */
+/* Updated: 2025/01/25 14:58:52 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,9 +22,14 @@ void *error(int err_code, char *err_text, int exit_code, int *ret_code)
return (NULL);
}
-void command_not_found_error(char *cmd)
+void *command_not_found_error(char *cmd, int *return_code, char *cmd_path,
+ char **split_path)
{
ft_printf("%s:", cmd);
ft_putstr_fd(" command not found", 2);
ft_printf("\n");
+ *return_code = 127;
+ free(cmd_path);
+ ft_free_split(split_path);
+ return (NULL);
}