about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2024-10-03 13:25:29 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-10-03 20:18:29 +0200
commite67f8e6dbd5ec98578a775b2e09b254f071e0f57 (patch)
treeef9956e8f867b3322221ff665ace7bf83957713f
parenta36814e1455093fc9ebfcdf6ef39bb0cf3d447da (diff)
downloadglibc-e67f8e6dbd5ec98578a775b2e09b254f071e0f57.tar.gz
glibc-e67f8e6dbd5ec98578a775b2e09b254f071e0f57.tar.xz
glibc-e67f8e6dbd5ec98578a775b2e09b254f071e0f57.zip
hurd: Add missing va_end call in fcntl implementation. [BZ #32234]
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Add va_end call in two code paths.
-rw-r--r--sysdeps/mach/hurd/fcntl.c6
1 files changed, 5 insertions, 1 deletions
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;