Author: fanningpj
Date: Fri Apr 28 09:13:08 2023
New Revision: 1909467

URL: http://svn.apache.org/viewvc?rev=1909467&view=rev
Log:
[bug-66584] ensure ZipPackage closes input stream when exceptions happen

Modified:
    
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java?rev=1909467&r1=1909466&r2=1909467&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java 
(original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackage.java 
Fri Apr 28 09:13:08 2023
@@ -127,11 +127,9 @@ public final class ZipPackage extends OP
      */
     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;
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to