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

            Bug ID: 56902
           Summary: DefaultServlet could leak resource in method copy -
                    CID-45243
           Product: Tomcat 8
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: felix.schumac...@internetallee.de

Created attachment 31955
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31955&action=edit
always close istream in DefaultServlet#copy

In method copy istream could be left unclosed, if write operations on ostream
would throw an exception before copyRange is called.

A simple fix is to wrap the ostream-operations together with copyRange in a
try-finally block.

If the exceptions should be catched into the variable exception like copyRange
does, it could be done so in an additionally catch block (which is missing from
the attached patch).

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to