From 4e0a90bdd71612bf66840824dee38fb0a403a406 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 7 Jun 2024 16:44:46 -0400 Subject: [PATCH] Dispose HttpClient in WorkloadManifestUpdater HttpClient is an IDisposable, so wrap it with a `using` to call Dispose() on it. --- .../dotnet-workload/install/WorkloadManifestUpdater.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs index 5635a4de10cd..a10b33e7d7f6 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs @@ -526,7 +526,8 @@ public IEnumerable ParseRollbackDefinitionFiles(IEnumerab if (Uri.TryCreate(rollbackDefinitionFilePath, UriKind.Absolute, out var rollbackUri) && !rollbackUri.IsFile) { - fileContent = (new HttpClient()).GetStringAsync(rollbackDefinitionFilePath).Result; + using HttpClient httpClient = new(); + fileContent = httpClient.GetStringAsync(rollbackDefinitionFilePath).Result; } else {