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

Resource leak in hudson.model.FileParameterValue

    Details

    • Similar Issues:

      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

          evernat evernat created issue -
          evernat evernat made changes -
          Field Original Value New Value
          Description A FileInputStream is not closed in [hudson.model.FileParameterValue|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/FileParameterValue.java#L260] 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();
          }
          A FileInputStream is not closed in [hudson.model.FileParameterValue|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/FileParameterValue.java#L260] for "return IOUtils.toByteArray(new FileInputStream(file))".
          This is a resource leak.

          The FileInputStream should be closed, using finally. For example:
          {code}
          final InputStream input = new FileInputStream(file);
          try {
              return IOUtils.toByteArray(input);
          } finally {
              input.close();
          }
          {code}
          oleg_nenashev Oleg Nenashev made changes -
          Assignee Oleg Nenashev [ oleg_nenashev ]
          oleg_nenashev Oleg Nenashev made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          danielbeck Daniel Beck made changes -
          Labels lts-candidate
          olivergondza Oliver Gond┼ża made changes -
          Labels lts-candidate 1.565.1-fixed
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 154804 ] JNJira + In-Review [ 195037 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: