Bug 58062 - Close IO Streams in finally statement
Summary: Close IO Streams in finally statement
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P2 critical
Target Milestone: ---
Assignee: log4j-dev
URL: https://github.com/apache/log4j/pull/2
Depends on:
Reported: 2015-06-20 15:22 UTC by Tang Xinye
Modified: 2015-06-25 04:02 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Tang Xinye 2015-06-20 15:22:49 UTC
The problem here is that if an exception is thrown during the read process the method will exit without closing the stream and hence without releasing the file system resources, it may run out of resources before it does run.I will make a commit in github right now.
Comment 1 Tang Xinye 2015-06-20 15:38:03 UTC
I've made a pull request in https://github.com/apache/log4j/pull/2/files to resolve the bug.
Comment 2 Gary Gregory 2015-06-25 04:02:21 UTC
Note that v1 is not actively maintained. I strongly encourage you to migrate to v2, which includes a v1.2 compatibility layer.