From d5fa7fe8a104b32d673990e41e0066dd32ffcaee Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 11 Sep 2023 16:24:42 +0800 Subject: [PATCH] libsel4muslcsys: fix va list leak in failure case va_start/va_end should call in pair Signed-off-by: chao an --- libsel4muslcsys/src/vsyscall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsel4muslcsys/src/vsyscall.c b/libsel4muslcsys/src/vsyscall.c index 44c22bb5d..92ce41881 100644 --- a/libsel4muslcsys/src/vsyscall.c +++ b/libsel4muslcsys/src/vsyscall.c @@ -271,6 +271,7 @@ long sel4_vsyscall(long sysnum, ...) int index = find_sparse_syscall(sysnum); if (index < 0) { debug_error(sysnum); + va_end(al); return -ENOSYS; } syscall = sparse_syscall_table[index].syscall; @@ -280,6 +281,7 @@ long sel4_vsyscall(long sysnum, ...) /* Check a syscall is implemented there */ if (!syscall) { debug_error(sysnum); + va_end(al); return -ENOSYS; } /* Call it */