Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1556

An incomplete fix for the resource leak bugs in ObjectFactory.java

    XMLWordPrintableJSON

Details

    Description

      The fix revision 319937 was aimed to remove an resource leak bug on the BufferedReader object "rd" in the method "findJarServiceProvider" of the file "/xerces/java/trunk/src/org/apache/html/dom/ObjectFactory.java
      " , but it is incomplete.

      However, when "rd" is not created successfully but the temp InputStreamReader object created at Line 462 or 464 is created successfully, these temp objects will be leaked.

      The buggy code locations the same fix needs to be applied at are as bellows:

      Line 462 and 464 of the method "findJarServiceProvider":

      try

      { [line 462] rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH); }

      catch (java.io.UnsupportedEncodingException e)

      { [line 464] rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            guangtai Guangtai Liang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified