summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pts.c
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2012-11-18 15:48:34 +0000
committermjg <mjg@FreeBSD.org>2012-11-18 15:48:34 +0000
commitfb4bab611cb46e64084e1050aa3606772ffe9b87 (patch)
treeb52aef7a5ba1435ec1fd856918341f401f772a36 /sys/kern/tty_pts.c
parent1617f53d51625afc6ae1af36b7223b13ac61c673 (diff)
downloadFreeBSD-src-fb4bab611cb46e64084e1050aa3606772ffe9b87.zip
FreeBSD-src-fb4bab611cb46e64084e1050aa3606772ffe9b87.tar.gz
Fix possible fp reference leak in posix_openpt
Reviewed by: ed Approved by: trasz (mentor) MFC after: 3 days
Diffstat (limited to 'sys/kern/tty_pts.c')
-rw-r--r--sys/kern/tty_pts.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c
index 4c272ad..d5efed3 100644
--- a/sys/kern/tty_pts.c
+++ b/sys/kern/tty_pts.c
@@ -836,6 +836,7 @@ sys_posix_openpt(struct thread *td, struct posix_openpt_args *uap)
error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp);
if (error != 0) {
fdclose(td->td_proc->p_fd, fp, fd, td);
+ fdrop(fp, td);
return (error);
}
OpenPOWER on IntegriCloud