Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-964

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.0.Beta29
    • None
    • None
    • None

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

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

              Created:
              Updated:
              Resolved: