Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22693

Resource leak in hudson.model.FileParameterValue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core

      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();
      }
      

            oleg_nenashev Oleg Nenashev
            evernat evernat
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: