cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugo Trippaers <h...@trippaers.nl>
Subject Fwd: New Defects reported by Coverity Scan for cloudstack
Date Fri, 06 Jun 2014 12:08:59 GMT
FYI

Begin forwarded message:

> From: scan-admin@coverity.com
> Subject: New Defects reported by Coverity Scan for cloudstack
> Date: 6 juni 2014 13:40:40 CEST
> 
> 
> Hi,
> 
> 
> Please find the latest report on new defect(s) introduced to cloudstack found with Coverity
Scan.
> 
> Defect(s) Reported-by: Coverity Scan
> Showing 2 of 2 defect(s)
> 
> 
> ** CID 1220836:  Dereference after null check  (FORWARD_NULL)
> /server/src/com/cloud/hypervisor/HypervisorGuruBase.java: 116 in com.cloud.hypervisor.HypervisorGuruBase.toNicTO(com.cloud.vm.NicProfile)()
> 
> ** CID 1220837:  Resource leak  (RESOURCE_LEAK)
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 301 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 321 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 301 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 321 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 1220836:  Dereference after null check  (FORWARD_NULL)
> /server/src/com/cloud/hypervisor/HypervisorGuruBase.java: 116 in com.cloud.hypervisor.HypervisorGuruBase.toNicTO(com.cloud.vm.NicProfile)()
> 110             }
> 111     
> 112             //check whether the this nic has secondary ip addresses set
> 113             //set nic secondary ip address in NicTO which are used for security group
> 114             // configuration. Use full when vm stop/start
> 115             List<String> secIps = null;
>>>>    CID 1220836:  Dereference after null check  (FORWARD_NULL)
>>>>    Calling a method on null object "nicVO".
> 116             if (nicVO.getSecondaryIp()) {
> 117                 secIps = _nicSecIpDao.getSecondaryIpAddressesForNic(nicVO.getId());
> 118             }
> 119             to.setNicSecIps(secIps);
> 120             return to;
> 121         }
> 
> ________________________________________________________________________________________________________
> *** CID 1220837:  Resource leak  (RESOURCE_LEAK)
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 301 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> 295                     long id = rs.getLong(1);
> 296                     String vlan = rs.getString(2);
> 297                     if (vlan == null || "".equals(vlan)) {
> 298                         continue;
> 299                     }
> 300                     String vlanUri = BroadcastDomainType.Vlan.toUri(vlan).toString();
>>>>    CID 1220837:  Resource leak  (RESOURCE_LEAK)
>>>>    Overwriting "pstmt" in "pstmt = conn.prepareStatement("update `cloud`.`vlan`
set vlan_id=? where id=?")" leaks the resource that "pstmt" refers to.
> 301                     pstmt = conn.prepareStatement("update `cloud`.`vlan` set vlan_id=?
where id=?");
> 302                     pstmt.setString(1, vlanUri);
> 303                     pstmt.setLong(2, id);
> 304                     pstmt.executeUpdate();
> 305                 }
> 306             } catch (SQLException e) {
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 321 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> 315                         pstmt.close();
> 316                     }
> 317                 } catch (SQLException e) {
> 318                 }
> 319             }
> 320             s_logger.debug("Done updateing vlan URIs");
>>>>    CID 1220837:  Resource leak  (RESOURCE_LEAK)
>>>>    Variable "pstmt" going out of scope leaks the resource it refers to.
> 321         }
> 322     
> 323         @Override
> 324         public File[] getCleanupScripts() {
> 325             String script = Script.findScript("", "db/schema-430to440-cleanup.sql");
> 326             if (script == null) {
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 301 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> 295                     long id = rs.getLong(1);
> 296                     String vlan = rs.getString(2);
> 297                     if (vlan == null || "".equals(vlan)) {
> 298                         continue;
> 299                     }
> 300                     String vlanUri = BroadcastDomainType.Vlan.toUri(vlan).toString();
>>>>    CID 1220837:  Resource leak  (RESOURCE_LEAK)
>>>>    Overwriting "pstmt" in "pstmt = conn.prepareStatement("update `cloud`.`vlan`
set vlan_id=? where id=?")" leaks the resource that "pstmt" refers to.
> 301                     pstmt = conn.prepareStatement("update `cloud`.`vlan` set vlan_id=?
where id=?");
> 302                     pstmt.setString(1, vlanUri);
> 303                     pstmt.setLong(2, id);
> 304                     pstmt.executeUpdate();
> 305                 }
> 306             } catch (SQLException e) {
> /engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java: 321 in com.cloud.upgrade.dao.Upgrade430to440.updateVlanUris(java.sql.Connection)()
> 315                         pstmt.close();
> 316                     }
> 317                 } catch (SQLException e) {
> 318                 }
> 319             }
> 320             s_logger.debug("Done updateing vlan URIs");
>>>>    CID 1220837:  Resource leak  (RESOURCE_LEAK)
>>>>    Variable "pstmt" going out of scope leaks the resource it refers to.
> 321         }
> 322     
> 323         @Override
> 324         public File[] getCleanupScripts() {
> 325             String script = Script.findScript("", "db/schema-430to440-cleanup.sql");
> 326             if (script == null) {
> 
> 
> ________________________________________________________________________________________________________
> To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/943?tab=overview
> 
> To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py
> 
> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message