Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-8851

Coverity static analysis, Resource leak on an exceptional path, FileAuditEndpoint (elytron)

    XMLWordPrintable

Details

    Description

      Coverity static analysis found possible occurence of resource leak.

      https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=9690272&defectInstanceId=2391428&mergedDefectId=1402977

      In constructor when fos.getFD() will throw exception FileOutputStream fos won't be closed.

      FileAuditEndpoint.java
          FileAuditEndpoint(Builder builder) throws IOException {
              this.dateFormatSupplier = builder.dateFormatSupplier;
              this.syncOnAccept = builder.syncOnAccept;
      
              FileOutputStream fos = new FileOutputStream(builder.location.toFile(), true);
              this.fileDescriptor = fos.getFD();
              this.outputStream = new BufferedOutputStream(fos);
          }
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-ivassile Ilia Vassilev
              mchoma@redhat.com Martin Choma
              Martin Choma Martin Choma
              Martin Choma Martin Choma
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: