diff mbox series

[hurd,commited] hurd: Add missing va_end call in fcntl implementation. [BZ #32234]

Message ID 20241003181923.1118011-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [hurd,commited] hurd: Add missing va_end call in fcntl implementation. [BZ #32234] | expand

Commit Message

Samuel Thibault Oct. 3, 2024, 6:19 p.m. UTC
From: Bruno Haible <bruno@clisp.org>

* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Add va_end call in two code paths.
---
 sysdeps/mach/hurd/fcntl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 9451ed5649..2583f54ef2 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -148,6 +148,7 @@  __libc_fcntl (int fd, int cmd, ...)
 	    cmd = F_SETLKW64;
 	    break;
 	  default:
+	    va_end (ap);
 	    return __hurd_fail (EINVAL);
 	  }
 
@@ -204,7 +205,10 @@  __libc_fcntl (int fd, int cmd, ...)
 		 && fl->l_start != fl64.l_start)
 	     || (sizeof fl->l_len != sizeof fl64.l_len
 		 && fl->l_len != fl64.l_len))
-	      return __hurd_fail (EOVERFLOW);
+	      {
+	        va_end (ap);
+	        return __hurd_fail (EOVERFLOW);
+	      }
 	  }
 
 	result = err ? __hurd_dfail (fd, err) : 0;