Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Close encrypted filestream #565

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions EPPlus/Utils/CompundDocument/CompoundDocumentFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ public static bool IsCompoundDocument(FileInfo fi)
{
try
{
var fs = fi.OpenRead();
var b = new byte[8];
fs.Read(b, 0, 8);
return IsCompoundDocument(b);
using (var fs = fi.OpenRead())
{
var b = new byte[8];
fs.Read(b, 0, 8);
return IsCompoundDocument(b);
}
}
catch
{
Expand Down