]
Ilia Vassilev reassigned ELY-964:
---------------------------------
Assignee: Ilia Vassilev (was: Darran Lofthouse)
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: Ilia Vassilev
Coverity static analysis found possible occurence of resource leak.
https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=96902...
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}