Plug a memory leak in dup2 when both old and new fd have ioctl caps.
Reviewed by: pjd MFC after: 3 days
This commit is contained in:
parent
0918d4b21f
commit
231a0fe857
@ -878,6 +878,7 @@ do_dup(struct thread *td, int flags, int old, int new,
|
||||
/*
|
||||
* Duplicate the source descriptor.
|
||||
*/
|
||||
filecaps_free(&newfde->fde_caps);
|
||||
*newfde = *oldfde;
|
||||
filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps);
|
||||
if ((flags & DUP_CLOEXEC) != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user