summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-06-08 16:05:22 +0000
committerderaadt <deraadt@openbsd.org>1999-06-08 16:05:22 +0000
commit4b1564403903358324af6f8b033951f077cc1700 (patch)
tree17903ce9ef4d301bf0bcb23e17ef5949391b0c3c /sys/compat/linux/linux_misc.c
parentuse sys_opipe(), but note the descriptor leakage (diff)
downloadwireguard-openbsd-4b1564403903358324af6f8b033951f077cc1700.tar.xz
wireguard-openbsd-4b1564403903358324af6f8b033951f077cc1700.zip
better fd leak prevention
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index c6efe014cd8..04509b7091d 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_misc.c,v 1.22 1999/06/08 15:47:39 deraadt Exp $ */
+/* $OpenBSD: linux_misc.c,v 1.23 1999/06/08 16:05:23 deraadt Exp $ */
/* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */
/*
@@ -656,7 +656,8 @@ linux_sys_pipe(p, v, retval)
#ifdef __i386__
retval[1] = reg_edx;
#endif /* __i386__ */
- /* XXX leaks descriptors */
+ fdrelease(p, retval[0]);
+ fdrelease(p, retval[1]);
return error;
}