mirror of
https://github.com/apache/poi.git
synced 2025-02-22 18:17:41 +00:00
[bug-66584] ensure ZipPackage closes input stream when exceptions happen
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1909467 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b88f3ac0ab
commit
fe3b4645b7
@ -127,11 +127,9 @@ public final class ZipPackage extends OPCPackage {
|
||||
*/
|
||||
ZipPackage(InputStream in, PackageAccess access) throws IOException {
|
||||
super(access);
|
||||
ZipArchiveThresholdInputStream zis = ZipHelper.openZipStream(in); // NOSONAR
|
||||
try {
|
||||
try (ZipArchiveThresholdInputStream zis = ZipHelper.openZipStream(in)) {
|
||||
this.zipArchive = new ZipInputStreamZipEntrySource(zis);
|
||||
} catch (final IOException | RuntimeException e) {
|
||||
IOUtils.closeQuietly(zis);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user