diff --git a/EPPlus/Utils/CompundDocument/CompoundDocumentFile.cs b/EPPlus/Utils/CompundDocument/CompoundDocumentFile.cs index 16d8f228..3c594bee 100644 --- a/EPPlus/Utils/CompundDocument/CompoundDocumentFile.cs +++ b/EPPlus/Utils/CompundDocument/CompoundDocumentFile.cs @@ -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 {