This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 309c902686 Review "Resolve nested JAR entries in JarFileUrlNestedJar 
using the..."
309c902686 is described below

commit 309c902686155f6a2a5e3f23cbffa825df3d137c
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Nov 4 16:10:46 2026 +0000

    Review "Resolve nested JAR entries in JarFileUrlNestedJar using the..."
    
    Fix leak
    
    Co-authored by: Claude / Sonnet 5.5
---
 java/org/apache/tomcat/util/scan/JarFileUrlNestedJar.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/java/org/apache/tomcat/util/scan/JarFileUrlNestedJar.java 
b/java/org/apache/tomcat/util/scan/JarFileUrlNestedJar.java
index c0583b5897..8fdb4382c2 100644
--- a/java/org/apache/tomcat/util/scan/JarFileUrlNestedJar.java
+++ b/java/org/apache/tomcat/util/scan/JarFileUrlNestedJar.java
@@ -49,6 +49,8 @@ public class JarFileUrlNestedJar extends 
AbstractInputStreamJar {
         // causes jarConn.getJarFile() above to throw.
         jarEntry = jarConn.getJarEntry();
         if (jarEntry == null) {
+            // The constructor is not going to complete so the caller can't 
close the JarFile
+            warFile.close();
             throw new FileNotFoundException(url.toExternalForm());
         }
     }


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

Reply via email to