coverity 1133705: output writer close Signed-off-by: Daan Hoogland <daan.hoogl...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8b350c37 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8b350c37 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8b350c37 Branch: refs/heads/master Commit: 8b350c37bd7b35234829c4709565eb339d99c2d5 Parents: 488ee88 Author: Daan Hoogland <d...@onecht.net> Authored: Fri Jul 17 15:47:39 2015 +0200 Committer: Daan Hoogland <daan.hoogl...@gmail.com> Committed: Mon Jul 27 14:43:11 2015 +0200 ---------------------------------------------------------------------- server/src/com/cloud/server/ConfigurationServerImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8b350c37/server/src/com/cloud/server/ConfigurationServerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 288eeeb..e7a928a 100644 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -650,11 +650,11 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio } else { // !keystoreFile.exists() and dbExisted // Export keystore to local file byte[] storeBytes = Base64.decodeBase64(dbString); - try { - String tmpKeystorePath = "/tmp/tmpkey"; - FileOutputStream fo = new FileOutputStream(tmpKeystorePath); + String tmpKeystorePath = "/tmp/tmpkey"; + try ( + FileOutputStream fo = new FileOutputStream(tmpKeystorePath); + ) { fo.write(storeBytes); - fo.close(); Script script = new Script(true, "cp", 5000, null); script.add("-f"); script.add(tmpKeystorePath);