-
Bug
-
Resolution: Done
-
Critical
-
7.1.0.DR9
Coverity static-analysis scan found 2 resource leaks in ProviderLoaderService class.
1)
https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=6892104&defectInstanceId=1794528&mergedDefectId=1388484
Following code is used in `load` method:
if (provider == null) { provider = providerClazz.newInstance(); if (configurationStreamSupplier != null) { try (InputStream is = configurationStreamSupplier.get()) { provider.load(configurationStreamSupplier.get()); } } }
The load method should use `is` instance instead of calling the supplier again.
2)
https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=6892104&defectInstanceId=1794527&mergedDefectId=1388483
Following code is used in `toInputStream` method:
SecurityActions.doPrivileged((PrivilegedExceptionAction<InputStream>) () -> new FileInputStream(file) ); return new FileInputStream(file);
There should be probably just:
return SecurityActions.doPrivileged((PrivilegedExceptionAction<InputStream>) () -> new FileInputStream(file) );
- is cloned by
-
WFLY-7828 Coverity static analysis: Resource leaks in ProviderLoaderService (Elytron subsystem)
- Closed
- is incorporated by
-
JBEAP-8259 Upgrade to Elytron Subsystem 1.0.0.Alpha20
- Closed