Fix possible fp reference leak in posix_openpt

Reviewed by:	ed
Approved by:	trasz (mentor)
MFC after:	3 days
This commit is contained in:
mjg 2012-11-18 15:48:34 +00:00
parent 1617f53d51
commit fb4bab611c

View File

@ -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);
}