summaryrefslogtreecommitdiff
path: root/kernel/cpu
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-04-02 09:17:06 +0200
committerAnton Kling <anton@kling.gg>2024-04-02 09:39:03 +0200
commit2229fd91f7230ae7068814ae029b733945852eb1 (patch)
tree416487f8c66c389c57dee465f648362ca59b8f23 /kernel/cpu
parent7eceb43433634ee253507208baf1d8298b40e377 (diff)
Kernel: Fix some memory leaks
Diffstat (limited to 'kernel/cpu')
-rw-r--r--kernel/cpu/syscall.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/cpu/syscall.c b/kernel/cpu/syscall.c
index d47f858..6789628 100644
--- a/kernel/cpu/syscall.c
+++ b/kernel/cpu/syscall.c
@@ -24,19 +24,18 @@ int syscall_exec(SYS_EXEC_PARAMS *args) {
argc++;
}
- char **new_argv = kallocarray(argc + 1, sizeof(char *));
+ char *new_argv[argc + 1];
for (int i = 0; i < argc; i++) {
new_argv[i] = copy_and_allocate_user_string(args->argv[i]);
}
new_argv[argc] = NULL;
- exec(filename, new_argv);
+ exec(filename, new_argv, 1, 1);
kfree((void *)filename);
for (int i = 0; i < argc; i++) {
kfree(new_argv[i]);
}
- kfree(new_argv);
return -1;
}
@@ -214,6 +213,7 @@ int (*syscall_functions[])() = {
(void(*))syscall_queue_add,
(void(*))syscall_queue_wait,
(void(*))syscall_munmap,
+ (void(*))syscall_open_process,
};
void int_syscall(reg_t *r);