| Summary: | Unsatisfied obligation to close OutputStream in Apache plug-in | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | Mike Foley <mfoley> |
| Component: | Plugins | Assignee: | Robert Buck <rbuck> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 4.1 | CC: | hrupp |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-02-07 19:22:13 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
bob ... u closed all streams from the coverity report en masse ...right? I did, but apparently this is one that crept by me. let me fix this, this is a two second fix. commit 0cf4f6b696f31e115165b826af14570a6b8a0b20 Author: Robert Buck <rbuck> Date: 2011-10-07 11:02:43 -0400 [BZ 721117] Fix IO stream resource leak; I fixed this previously, but as I was in here I fixed a few minor issues, making it code-green. changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE |
Description of problem: An output stream is opened, but not closed in the Apache plug-in. Specifically, org.rhq.plugins.apache.parser.saveFile() Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Unsatisfied programmatic obligation to close OutputStream results in resource leaks. Expected results: Fufill programmatic obligation to close Outputstream to avoid resource leaks. Additional info: public void saveFile(String file,ApacheDirective dir) throws Exception{ File fl = new File(file); if (!fl.exists()) fl.createNewFile(); OutputStream str = new FileOutputStream(fl); for (ApacheDirective d : dir.getChildDirectives()){ if (dir.getFile().equals(file)){ writeToFile(str,dir,file); } } }