summary refs log tree commit diff
path: root/crypto/src/cms/CMSProcessableFile.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/cms/CMSProcessableFile.cs')
-rw-r--r--crypto/src/cms/CMSProcessableFile.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/src/cms/CMSProcessableFile.cs b/crypto/src/cms/CMSProcessableFile.cs
index 255c8432f..0344759cc 100644
--- a/crypto/src/cms/CMSProcessableFile.cs
+++ b/crypto/src/cms/CMSProcessableFile.cs
@@ -34,9 +34,10 @@ namespace Org.BouncyCastle.Cms
 
         public virtual void Write(Stream zOut)
 		{
-			Stream inStr = _file.OpenRead();
-            Streams.PipeAll(inStr, zOut, _bufSize);
-            Platform.Dispose(inStr);
+			using (var inStr = _file.OpenRead())
+			{
+                Streams.PipeAll(inStr, zOut, _bufSize);
+            }
 		}
 	}
 }