mirror of https://github.com/apache/cloudstack.git
linstor: Fix a file handle resource leak opening template.properties (#13091)
This commit is contained in:
parent
519715e81a
commit
5b9a3d7d32
|
|
@ -585,8 +585,8 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
|
|||
Path propFile = diskPath.getParent().resolve("template.properties");
|
||||
if (Files.exists(propFile)) {
|
||||
java.util.Properties templateProps = new java.util.Properties();
|
||||
try {
|
||||
templateProps.load(new FileInputStream(propFile.toFile()));
|
||||
try (FileInputStream in = new FileInputStream(propFile.toFile())) {
|
||||
templateProps.load(in);
|
||||
String desc = templateProps.getProperty("description");
|
||||
if (desc != null && desc.startsWith("SystemVM Template")) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue