-
Bug
-
Resolution: Fixed
-
Major
A FileInputStream is not closed in hudson.model.FileParameterValue for "return IOUtils.toByteArray(new FileInputStream(file))".
This is a resource leak.
The FileInputStream should be closed, using finally. For example:
final InputStream input = new FileInputStream(file); try { return IOUtils.toByteArray(input); } finally { input.close(); }
[JENKINS-22693] Resource leak in hudson.model.FileParameterValue
Description |
Original:
A FileInputStream is not closed in [hudson.model.FileParameterValue|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/FileParameterValue.java#L260] for "return IOUtils.toByteArray(new FileInputStream(file))". This is a resource leak. The FileInputStream should be closed, using finally. For example: final InputStream input = new FileInputStream(file); try { return IOUtils.toByteArray(input); } finally { input.close(); } |
New:
A FileInputStream is not closed in [hudson.model.FileParameterValue|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/FileParameterValue.java#L260] for "return IOUtils.toByteArray(new FileInputStream(file))". This is a resource leak. The FileInputStream should be closed, using finally. For example: {code} final InputStream input = new FileInputStream(file); try { return IOUtils.toByteArray(input); } finally { input.close(); } {code} |
Assignee | New: Oleg Nenashev [ oleg_nenashev ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Labels | New: lts-candidate |
The PR just hangs for several weeks...
https://github.com/jenkinsci/jenkins/pull/1225