Skip to content

Commit

Permalink
Fix valgrind errors for agent
Browse files Browse the repository at this point in the history
Fixed following errors
1.  Use of delete instead of delete[]
2.  Use of unitialized variables in couple of places.

Partial-Bug: #1641833
(cherry picked from commit 3def48d)

Change-Id: I8edac4497a673f9d923a47bfb94fb7ff66bb3d23
  • Loading branch information
ashoksr committed Nov 30, 2016
1 parent fdeeb68 commit edb3fb3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ksync/ksync_sock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ KSyncBulkMsgContext::~KSyncBulkMsgContext() {
assert(vr_response_count_ == io_context_list_.size());
io_context_list_.clear_and_dispose(IoContextDisposer());
for (uint32_t i = 0; i < rx_buffer_index_; i++) {
delete rx_buffers_[i];
delete[] rx_buffers_[i];
}
}

Expand Down
1 change: 1 addition & 0 deletions src/ksync/ksync_tx_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ KSyncTxQueue::KSyncTxQueue(KSyncSock *sock) :
measure_busy_time_(false) {
queue_len_ = 0;
shutdown_ = false;
ClearStats();
}

KSyncTxQueue::~KSyncTxQueue() {
Expand Down
1 change: 1 addition & 0 deletions src/vnsw/agent/vrouter/ksync/flowtable_ksync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void FlowTableKSyncEntry::Reset() {
trap_flow_ = false;
old_drop_reason_ = 0;
ecmp_ = false;
enable_rpf_ = true;
src_nh_id_ = NextHopTable::kRpfDiscardIndex;
last_event_ = FlowEvent::INVALID;
token_.reset();
Expand Down

0 comments on commit edb3fb3

Please sign in to comment.