Hide Forgot
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); } } }
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