Coverity issues in contrail-controller/agent

Bug #1770193 reported by Anda-Maria Nicolae
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Medium
Anda-Maria Nicolae
Trunk
Fix Committed
Medium
Anda-Maria Nicolae
OpenContrail
New
Undecided
Unassigned

Bug Description

Hi all,

I have run Coverity on branch R5.0 and it reported the following issues in contrail-controller/agent:

- leaked_storage: Variable key going out of scope leaks the storage it points to in vm_interface_config.cc:VmiProcessConfig
Must free key and data if data->device_type_ is VmInterface::REMOTE_VM_VLAN_ON_VMI.

- leaked_storage: Variable pkt_handler going out of scope leaks the storage it points to in segment_health_check.cc:SendRequest
Must free pkt_handler if service_mode is VmInterface::SERVICE_MODE_ERROR.

- bad_memset: Function memset with fill value '0' (the zero character) in bgp_as_service.cc:BingBgpAsAServicePorts.cc
Correct is 0 instead of '0'.

- leaked_storage: Variable data going out of scope leaks the storage it points to in
Actually, data is freed, but it needs to be freed by calling delete [] data instead of free(data), because it was previously allocated by calling new[].

Revision history for this message
Anda-Maria Nicolae (anicolae) wrote :

- leaked_storage: Variable data going out of scope leaks the storage it points to in nexthop_client.cc:WriteMessage

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/42906
Submitter: Anda Nicolae (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/42907
Submitter: Anda Nicolae (<email address hidden>)

Jeba Paulaiyan (jebap)
tags: added: contrail-control vrouter
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/42906
Committed: http://github.com/Juniper/contrail-controller/commit/0b891f357b815a611f857474b5f5dbc2c86e8199
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit 0b891f357b815a611f857474b5f5dbc2c86e8199
Author: Anda Nicolae <email address hidden>
Date: Wed May 9 18:54:33 2018 +0300

Coverity issues in contrail-controller/agent

- leaked_storage: Variable key going out of scope leaks the storage
it points to in vm_interface_config.cc:VmiProcessConfig
Must free key and data if data->device_type_ is
VmInterface::REMOTE_VM_VLAN_ON_VMI.
- leaked_storage: Variable pkt_handler going out of scope leaks the
storage it points to in segment_health_check.cc:SendRequest
Must free pkt_handler if service_mode is VmInterface::SERVICE_MODE_ERROR.
- bad_memset: Function memset with fill value '0' (the zero character)
in bgp_as_service.cc:BingBgpAsAServicePorts.cc
Correct is 0 instead of '0'.
- leaked_storage: Variable data going out of scope leaks the storage it
points to in nexthop_client.cc:WriteMessage
Actually, data is freed, but it needs to be freed by calling delete [] data
instead of free(data), because it was previsouly allocated by calling new[].

Change-Id: Ibbb94df3ac0fa4ef41789137aed4dc15fa4b3e84
Closes-Bug: #1770193
Signed-off-by: Anda Nicolae <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/42907
Committed: http://github.com/Juniper/contrail-controller/commit/32e41ccb418e8bcd9c50420c48cd052a65a89f23
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 32e41ccb418e8bcd9c50420c48cd052a65a89f23
Author: Anda Nicolae <email address hidden>
Date: Wed May 9 18:54:33 2018 +0300

Coverity issues in contrail-controller/agent

- leaked_storage: Variable key going out of scope leaks the storage
it points to in vm_interface_config.cc:VmiProcessConfig
Must free key and data if data->device_type_ is
VmInterface::REMOTE_VM_VLAN_ON_VMI.
- leaked_storage: Variable pkt_handler going out of scope leaks the
storage it points to in segment_health_check.cc:SendRequest
Must free pkt_handler if service_mode is VmInterface::SERVICE_MODE_ERROR.
- bad_memset: Function memset with fill value '0' (the zero character)
in bgp_as_service.cc:BingBgpAsAServicePorts.cc
Correct is 0 instead of '0'.
- leaked_storage: Variable data going out of scope leaks the storage it
points to in nexthop_client.cc:WriteMessage
Actually, data is freed, but it needs to be freed by calling delete [] data
instead of free(data), because it was previsouly allocated by calling new[].

Change-Id: Ibbb94df3ac0fa4ef41789137aed4dc15fa4b3e84
Closes-Bug: #1770193
Signed-off-by: Anda Nicolae <email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.