cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] git commit: updated refs/heads/master to c1ac5f3
Date Mon, 03 Aug 2015 09:09:29 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master b6a06b4bf -> c1ac5f3ab


CLOUDSTACK-8692: Resource leak found by the internal coverity instance at Citrix fixed.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e0ba5302
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e0ba5302
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e0ba5302

Branch: refs/heads/master
Commit: e0ba5302b66283c56819c49786d75f2f0bb53873
Parents: b400608
Author: Kshitij Kansal <kshitij.kansal@citrix.com>
Authored: Thu Jul 30 16:23:50 2015 +0530
Committer: Kshitij Kansal <kshitij.kansal@citrix.com>
Committed: Mon Aug 3 11:21:50 2015 +0530

----------------------------------------------------------------------
 .../src/org/apache/cloudstack/region/RegionsApiUtil.java  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0ba5302/server/src/org/apache/cloudstack/region/RegionsApiUtil.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/region/RegionsApiUtil.java b/server/src/org/apache/cloudstack/region/RegionsApiUtil.java
index 92c5ed4..7fbcfa0 100644
--- a/server/src/org/apache/cloudstack/region/RegionsApiUtil.java
+++ b/server/src/org/apache/cloudstack/region/RegionsApiUtil.java
@@ -186,8 +186,12 @@ public class RegionsApiUtil {
                 XStream xstream = new XStream(new DomDriver());
                 xstream.alias("useraccount", UserAccountVO.class);
                 xstream.aliasField("id", UserAccountVO.class, "uuid");
-                ObjectInputStream in = xstream.createObjectInputStream(is);
-                return (UserAccountVO)in.readObject();
+                try(ObjectInputStream in = xstream.createObjectInputStream(is);) {
+                    return (UserAccountVO)in.readObject();
+                } catch (IOException e) {
+                    s_logger.error(e.getMessage());
+                    return null;
+                }
             } else {
                 return null;
             }
@@ -304,4 +308,4 @@ public class RegionsApiUtil {
         }
     }
 
-}
\ No newline at end of file
+}


Mime
View raw message