cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject git commit: updated refs/heads/master to 2424d9a
Date Tue, 03 Jun 2014 07:18:36 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 8b6dc7ce2 -> 2424d9a9e


Fixed ResouceLeak on pstmtCidr in the function Upgrade430to440.moveCidrsToTheirOwnTable as
reported by coverity

Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>


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

Branch: refs/heads/master
Commit: 2424d9a9e0f1189044303a98c40e60033808f0b2
Parents: 8b6dc7c
Author: Rajani Karuturi <rajanikaruturi@gmail.com>
Authored: Tue Jun 3 12:31:20 2014 +0530
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Tue Jun 3 09:09:55 2014 +0200

----------------------------------------------------------------------
 .../schema/src/com/cloud/upgrade/dao/Upgrade430to440.java | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2424d9a9/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
index 351b74a..7fe285f 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
@@ -254,14 +254,12 @@ public class Upgrade430to440 implements DbUpgrade {
                 String[] cidrArray = cidrList.split(",");
                 // insert a record per cidr
                 String networkAclItemCidrSql = "INSERT INTO `cloud`.`network_acl_item_cidrs`
(network_acl_item_id, cidr) VALUES (?,?)";
-                for(String cidr: cidrArray)
-                {
-                    pstmtCidr = conn.prepareStatement(networkAclItemCidrSql);
-                    pstmtCidr.setLong(1,itemId);
-                    pstmtCidr.setString(2,cidr);
+                pstmtCidr = conn.prepareStatement(networkAclItemCidrSql);
+                pstmtCidr.setLong(1, itemId);
+                for (String cidr : cidrArray) {
+                    pstmtCidr.setString(2, cidr);
                     pstmtCidr.executeUpdate();
                 }
-                pstmtCidr.close();
             }
         } catch (SQLException e) {
             throw new CloudRuntimeException("Exception while Moving network acl item cidrs
to a row per cidr", e);


Mime
View raw message