You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/02/21 12:58:35 UTC

DO NOT REPLY [Bug 52727] New: An incomplete fix for the resource leak bug in HostConfig.java

https://issues.apache.org/bugzilla/show_bug.cgi?id=52727

             Bug #: 52727
           Summary: An incomplete fix for the resource leak bug in
                    HostConfig.java
           Product: Tomcat 7
           Version: trunk
          Platform: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: lianggt08@sei.pku.edu.cn
    Classification: Unclassified


The fix revision 423920  was aimed to remove an resource leak bug on the 
BufferedOutputStream object "ostream " (created line 804) in the method
"deployWAR" of the file
"/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java" , but it is
incomplete. 

There are some problems: 
1. when "ostream" is not created successfully but the  temp FileOutputStream
object  is created successfully  , the temp  FileOutputStream  object  will be 
leaked. 

The best way to close such resource objects is putting such close operations
for each object in the finaly block of a try-catch-finally structure.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 52727] An incomplete fix for the resource leak bug in HostConfig.java

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52727

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         OS/Version|                            |All
           Severity|critical                    |enhancement

--- Comment #1 from Mark Thomas <ma...@apache.org> 2012-03-06 21:16:48 UTC ---
r423920 had nothing to do with attempting to fix a resource leak.

The only failures that might occur during the constructor of
BufferedOutputStream are the sort that signify far bigger problems that a
resource leak.

Yet another bug with an over-stated severity that should be an enhancement
request to clean-up the code.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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