You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/04/17 15:02:15 UTC

[tomcat] branch master updated: Fix a potential resource leak.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 108df0e  Fix a potential resource leak.
108df0e is described below

commit 108df0e38ea841aa153161d39342f84266ad4a22
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Apr 17 16:01:41 2019 +0100

    Fix a potential resource leak.
    
    Identified by Coverity scan.
---
 java/org/apache/catalina/webresources/JarWarResource.java | 2 ++
 webapps/docs/changelog.xml                                | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/java/org/apache/catalina/webresources/JarWarResource.java b/java/org/apache/catalina/webresources/JarWarResource.java
index 90321ee..cce1233 100644
--- a/java/org/apache/catalina/webresources/JarWarResource.java
+++ b/java/org/apache/catalina/webresources/JarWarResource.java
@@ -72,6 +72,8 @@ public class JarWarResource extends AbstractArchiveResource {
                 log.debug(sm.getString("jarResource.getInputStreamFail",
                         getResource().getName(), getBaseUrl()), e);
             }
+            // Ensure jarIs is closed if there is an exception
+            entry = null;
             return null;
         } finally {
             if (entry == null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 73ac6fb..534424d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -64,6 +64,10 @@
         Fix a potential concurrency issue in the main Sendfile thread of the APR
         connector. Identified by Coverity scan. (markt)
       </fix>
+      <fix>
+        Fix a potential resource leak when running a web application from a WAR
+        file. Identified by Coverity scan. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org