title: Fortify security issue "Unreleased resource stream"
body: <p>I am getting a fortify finding for "Unreleased resource stream" on the code below.</p>
  
  <pre class="lang-java prettyprint-override"><code>Resource[] l_objResource = resourceLoader.getResources(configErrorCode);
  Properties l_objProperty = null;
  for (int i = 0; i &lt; l_objResource.length; i++) {
      l_objProperty = new Properties();
      l_objProperty.load(l_objResource[i].getInputStream());
  }
  </code></pre>
  
  <p>The function <code>loadErrorCode()</code> in <code>BaseErrorParser.java</code> sometimes fails to release a system resource allocated by <code>getInputStream();</code></p>
  
  <p>Can anyone explain the finding or help fix the issue?</p>
  
  <hr>
  
  <p>From the comment below, but the context is not clear (JW):</p>
  
  <pre><code>ObjectInputStream l_objObjInputStream = null;
  Map l_mapRet = null;
  try {
      l_objObjInputStream = new ObjectInputStream(new FileInputStream(p_objFilename));
      Object l_objTemp = l_objObjInputStream.readObject();
      l_mapRet = (Map) l_objTemp;
  } finally {
      if (l_objObjInputStream != null) {
          l_objObjInputStream.close();
      }
  }
  </code></pre>