Open
Description
I analyzed the ASP .NET Core code using the Svace static analyzer. It has found a HANDLE_LEAK category error with the following message:
new ReadableJsonConfigurationProvider() is not disposed at the end of the function
in method Execute(CommandContext context)
. Here's a source code:
aspnetcore/src/Tools/dotnet-user-secrets/src/Internal/SetCommand.cs
Lines 61 to 84 in d088530
An instance of the ReadableJsonConfigurationProvider
class is created and can be disposed of.
What about adjusting this method to ensure proper disposal with a using
statement?
Like this:
using var provider = new ReadableJsonConfigurationProvider();
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Reporter: Aleksey Kolosov ([email protected]).
Organization: [email protected]