mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Fix possible fp reference leak in posix_openpt
Reviewed by: ed Approved by: trasz (mentor) MFC after: 3 days
This commit is contained in:
parent
0fa8505bb7
commit
dd103d4d06
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243234
@ -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);
|
error = pts_alloc(FFLAGS(uap->flags & O_ACCMODE), td, fp);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
fdclose(td->td_proc->p_fd, fp, fd, td);
|
fdclose(td->td_proc->p_fd, fp, fd, td);
|
||||||
|
fdrop(fp, td);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user