-
Bug
-
Resolution: Done
-
Critical
-
None
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) );
- clones
-
JBEAP-7923 Coverity static analysis: Resource leaks in ProviderLoaderService (Elytron subsystem)
- Closed
- is incorporated by
-
WFLY-7883 Upgrade to Elytron Subsystem 1.0.0.Alpha20
- Closed