From ed5c170d50b218d5570bea21933a69caf374d8bf Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 10 Apr 2024 01:19:51 -0400 Subject: kernel: filedesc: Fix memory leak in sys_read() Signed-off-by: Ian Moffett --- sys/kern/kern_filedesc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys') diff --git a/sys/kern/kern_filedesc.c b/sys/kern/kern_filedesc.c index e4fe2f6..abea45b 100644 --- a/sys/kern/kern_filedesc.c +++ b/sys/kern/kern_filedesc.c @@ -466,6 +466,7 @@ sys_read(struct syscall_args *args) if (copyout(kbuf, args->arg1, bytes_read) != 0) { invalid_uaddr(args->arg1); } + dynfree(kbuf); return bytes_read; } -- cgit v1.2.3