From f27a5f8af9fc5a16b80a7d6646e44d718b0efd7d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 9 Jan 2021 22:29:05 +0100 Subject: Finding memory leaks is SO exhausting argh --- kernel/drivers/keyboard.c | 2 -- kernel/features/proc.c | 2 +- kernel/main.c | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) (limited to 'kernel') diff --git a/kernel/drivers/keyboard.c b/kernel/drivers/keyboard.c index ac97d36..e8690f1 100644 --- a/kernel/drivers/keyboard.c +++ b/kernel/drivers/keyboard.c @@ -28,8 +28,6 @@ void keyboard_handler() // TODO: "Merge" scancode to linux keycode? /* printf("%x %x = %x\n", scancode, state ? 0xe0 : 0, merged); */ - if (event) - free(event); event = malloc(sizeof(*event)); event->magic = KEYBOARD_MAGIC; event->press = (scancode & 0x80) == 0; diff --git a/kernel/features/proc.c b/kernel/features/proc.c index c0216bc..76da36d 100644 --- a/kernel/features/proc.c +++ b/kernel/features/proc.c @@ -90,7 +90,7 @@ void proc_send(struct proc *src, struct proc *dest, u32 type, void *data) struct proc_message *msg = malloc(sizeof(*msg)); msg->src = src; msg->dest = dest; - msg->msg = malloc(sizeof(struct message)); + msg->msg = malloc(sizeof(*msg->msg)); msg->msg->src = (int)src->pid; msg->msg->type = (int)type; msg->msg->data = data; diff --git a/kernel/main.c b/kernel/main.c index 665d474..563cae7 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3