summary refs log tree commit diff
path: root/crypto/src/x509/X509V2AttributeCertificate.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/x509/X509V2AttributeCertificate.cs')
-rw-r--r--crypto/src/x509/X509V2AttributeCertificate.cs7
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)
 			{