dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.58k stars 4.55k forks source link

It's possible for handles to not be Dispose()d if AnonymousPipeServerStream.Create throws #103912

Open omajid opened 2 weeks ago

omajid commented 2 weeks ago

https://github.com/dotnet/runtime/blob/98e75704a85bfe4a71dd5932c8a2e5f860a09d05/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.Unix.cs#L20-L50

If we hit that throw condition, we don't Dispose() the serverHandle or the clientHandle.

dotnet-policy-service[bot] commented 2 weeks ago

Tagging subscribers to this area: @dotnet/area-system-io See info in area-owners.md if you want to be subscribed.

stephentoub commented 2 weeks ago

we don't Dispose() the serverHandle or the clientHandle.

We don't, but for clarity it's not a leak: they'll still be finalized.