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

Resource leak in hudson.model.FileParameterValue

    XMLWordPrintable

Details

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: