Skip to content

Commit

Permalink
It's possible for handles to not be Dispose()d if AnonymousPipeServer…
Browse files Browse the repository at this point in the history
…Stream.Create throws (#104196)
  • Loading branch information
pedrobsaila committed Jul 15, 2024
1 parent af5e715 commit 916e245
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ private void Create(PipeDirection direction, HandleInheritability inheritability
if (inheritability == HandleInheritability.Inheritable &&
Interop.Sys.Fcntl.SetFD(clientHandle, 0) == -1)
{
serverHandle.Dispose();
clientHandle.Dispose();
throw Interop.GetExceptionForIoErrno(Interop.Sys.GetLastErrorInfo());
}

Expand Down

0 comments on commit 916e245

Please sign in to comment.