Skip to content

Commit

Permalink
libsel4muslcsys: fix va list leak in failure case
Browse files Browse the repository at this point in the history
va_start/va_end should call in pair

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and Indanz committed Nov 1, 2023
1 parent f8aabb6 commit d5fa7fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libsel4muslcsys/src/vsyscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit d5fa7fe

Please sign in to comment.