diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-09 01:13:27 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-09 01:13:27 +0700 |
commit | a8a17fd70fc8df3ca7402323ad5c4f36b25cb806 (patch) | |
tree | 9b276b62885505abbb899d17744b65b912072140 /crypto/src/x509/X509V2AttributeCertificate.cs | |
parent | Primes improvements (diff) | |
download | BouncyCastle.NET-ed25519-a8a17fd70fc8df3ca7402323ad5c4f36b25cb806.tar.xz |
Dispose cleanup
- IDisposable for PemReader, PemWriter, IStreamGenerator
Diffstat (limited to 'crypto/src/x509/X509V2AttributeCertificate.cs')
-rw-r--r-- | crypto/src/x509/X509V2AttributeCertificate.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/src/x509/X509V2AttributeCertificate.cs b/crypto/src/x509/X509V2AttributeCertificate.cs index fbb4fe20f..61702aebd 100644 --- a/crypto/src/x509/X509V2AttributeCertificate.cs +++ b/crypto/src/x509/X509V2AttributeCertificate.cs @@ -192,9 +192,10 @@ namespace Org.BouncyCastle.X509 { byte[] b = this.cert.ACInfo.GetEncoded(); - streamCalculator.Stream.Write(b, 0, b.Length); - - Platform.Dispose(streamCalculator.Stream); + using (var stream = streamCalculator.Stream) + { + stream.Write(b, 0, b.Length); + } } catch (IOException e) { |