Missing dispose.
MODIFY
WalletWasabi/Crypto/SchnorrBlindingSignature.cs
WalletWasabi/Crypto/SchnorrBlindingSignature.cs
@@ -137,11 +137,17 @@ namespace WalletWasabi.Crypto
throw new ArgumentException("Invalid blinded message.", nameof(blindedMessage));
}
- if (!Context.Instance.TryCreateECPrivKey(rKey.ToBytes(), out var r))
+ ECPrivKey? r = null;
+ ECPrivKey? d = null;
+
+ try
+ {
+ if (!Context.Instance.TryCreateECPrivKey(rKey.ToBytes(), out r))
{
throw new FormatException("Invalid key.");
}
- if (!Context.Instance.TryCreateECPrivKey(Key.ToBytes(), out var d))
+
+ if (!Context.Instance.TryCreateECPrivKey(Key.ToBytes(), out d))
{
throw new FormatException("Invalid key.");
}
@@ -150,6 +156,12 @@ namespace WalletWasabi.Crypto
sp.WriteToSpan(tmp);
return new uint256(tmp);
}
+ finally
+ {
+ r?.Dispose();
+ d?.Dispose();
+ }
+ }
public bool VerifyUnblindedSignature(UnblindedSignature signature, uint256 dataHash)
{

Missing dispose.

Signed-off-by: Kiminuo <kiminuo@protonmail.com>