summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-01-06 13:19:05 +0000
committernectar <nectar@FreeBSD.org>2003-01-06 13:19:05 +0000
commit266526442d75736b6f9ba0af867862398750359a (patch)
tree964e733fa29037843c054f928b2b37538b1d7fe6 /sys/kern/kern_descrip.c
parenta7aae2379c9310619baaa6ab29d726e8225034e2 (diff)
downloadFreeBSD-src-266526442d75736b6f9ba0af867862398750359a.zip
FreeBSD-src-266526442d75736b6f9ba0af867862398750359a.tar.gz
Correct file descriptor leaks in lseek and do_dup.
The leak in lseek was introduced in vfs_syscalls.c revision 1.218. The leak in do_dup was introduced in kern_descrip.c revision 1.158. Submitted by: iedowse
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index bc14c61..e5a2114 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -483,6 +483,7 @@ do_dup(td, type, old, new, retval)
error = fdalloc(td, new, &newfd);
if (error) {
FILEDESC_UNLOCK(fdp);
+ fdrop(fp, td);
return (error);
}
}
OpenPOWER on IntegriCloud