summary refs log tree commit diff
path: root/crypto/src/asn1/LazyDLSequence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/LazyDLSequence.cs')
-rw-r--r--crypto/src/asn1/LazyDLSequence.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/src/asn1/LazyDLSequence.cs b/crypto/src/asn1/LazyDLSequence.cs
index d45706bb3..a9f155359 100644
--- a/crypto/src/asn1/LazyDLSequence.cs
+++ b/crypto/src/asn1/LazyDLSequence.cs
@@ -101,10 +101,13 @@ namespace Org.BouncyCastle.Asn1
             {
                 if (null != encoded)
                 {
-                    Asn1InputStream input = new LazyAsn1InputStream(encoded);
                     try
                     {
-                        Asn1EncodableVector v = input.ReadVector();
+                        Asn1EncodableVector v;
+                        using (var input = new LazyAsn1InputStream(encoded))
+                        {
+                            v = input.ReadVector();
+                        }
 
                         this.elements = v.TakeElements();
                         this.encoded = null;