[jboss-jira] [JBoss JIRA] (ELY-964) Coverity static analysis, Resource leak on an exceptional path, FileAuditEndpoint (elytron)

Martin Choma (JIRA) issues at jboss.org
Wed Feb 15 04:53:00 EST 2017


Martin Choma created ELY-964:
--------------------------------

             Summary: Coverity static analysis, Resource leak on an exceptional path, FileAuditEndpoint (elytron)
                 Key: ELY-964
                 URL: https://issues.jboss.org/browse/ELY-964
             Project: WildFly Elytron
          Issue Type: Bug
            Reporter: Martin Choma
            Assignee: Darran Lofthouse


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.

{code:java|title=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);
    }
{code}




--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list