Bug 56900 - Resource Leaks found by CID 45266 and 45249
Summary: Resource Leaks found by CID 45266 and 45249
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 minor (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-30 13:38 UTC by Felix Schumacher
Modified: 2014-09-03 15:45 UTC (History)
0 users



Attachments
Close InputStream after use. Factor out common code into a private method. (5.77 KB, patch)
2014-08-30 13:38 UTC, Felix Schumacher
Details | Diff
Close InputStream after use in ContextConfig (1.02 KB, patch)
2014-08-30 13:39 UTC, Felix Schumacher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Schumacher 2014-08-30 13:38:41 UTC
Created attachment 31953 [details]
Close InputStream after use. Factor out common code into a private method.

InputStreams are not closed after using them for loading the content into properties.

This happens a few times in the code base and seems to be a common task. Maybe we should create a utility-method to capsulate that funtion.

For DefaultInstanceManager I have created a private method. For ContextConfig I adapted to local logic only.
Comment 1 Felix Schumacher 2014-08-30 13:39:21 UTC
Created attachment 31954 [details]
Close InputStream after use in ContextConfig
Comment 2 Mark Thomas 2014-09-01 10:07:48 UTC
Thanks for the patches. I applied a variation of them (I used try with resources to reduce the code) to 8.0.x and this will be included in 8.0.13 onwards.
Comment 3 Violeta Georgieva 2014-09-03 15:45:49 UTC
Fix is committed to 7.0.x and will be available in 7.0.56 onwards.