Dispose IDisposable instances (#15810)

This commit is contained in:
Chad
2024-03-14 03:59:28 +13:00
committed by GitHub
parent ac5539a8be
commit 2fbda6e64b
7 changed files with 16 additions and 10 deletions

View File

@@ -98,7 +98,10 @@ public class PasswordGenerator
var data = new byte[length];
var chArray = new char[length];
var num1 = 0;
new RNGCryptoServiceProvider().GetBytes(data);
using (var rng = new RNGCryptoServiceProvider())
{
rng.GetBytes(data);
}
for (var index = 0; index < length; ++index)
{