mirror of https://github.com/apache/cloudstack.git
Fixed ResouceLeak on pstmtCidr in the function Upgrade430to440.moveCidrsToTheirOwnTable as reported by coverity
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
This commit is contained in:
parent
8b6dc7ce2f
commit
2424d9a9e0
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue