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

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


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

commit cf1312430645675a4ac9ef8db7bfe76cf2136335
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