From coverity: fix resource leak
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2215 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
06741a59c9
commit
e65a0361f5
|
@ -38,8 +38,19 @@ public class OSXInfoPlist {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String getInfoPlistContent() throws IOException {
|
protected static String getInfoPlistContent() throws IOException {
|
||||||
FileInputStream fileInputStream = new FileInputStream(getInfoPlistPath());
|
FileInputStream fileInputStream = null;
|
||||||
return new String(IOUtil.readFully(fileInputStream));
|
try {
|
||||||
|
fileInputStream = new FileInputStream(getInfoPlistPath());
|
||||||
|
return new String(IOUtil.readFully(fileInputStream));
|
||||||
|
} finally {
|
||||||
|
if (fileInputStream != null) {
|
||||||
|
try {
|
||||||
|
fileInputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue