tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1408163 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
Date Mon, 12 Nov 2012 01:15:53 GMT
Author: markt
Date: Mon Nov 12 01:15:52 2012
New Revision: 1408163

URL: http://svn.apache.org/viewvc?rev=1408163&view=rev
Log:
Fix memory leak that prevents context.xml files associated with failed deployments from being
deleted.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1408163&r1=1408162&r2=1408163&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Mon Nov 12 01:15:52 2012
@@ -545,10 +545,11 @@ public class HostConfig
         boolean isExternalWar = false;
         boolean isExternal = false;
         File expandedDocBase = null;
-        try {
+
+        try (FileInputStream fis = new FileInputStream(contextXml)) {
             synchronized (digester) {
                 try {
-                    context = (Context) digester.parse(contextXml);
+                    context = (Context) digester.parse(fis);
                 } catch (Exception e) {
                     log.error(sm.getString(
                             "hostConfig.deployDescriptor.error",



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


Mime
View raw message