Skip to content

Commit

Permalink
Memory leak in AgentPath::ReorderCompositeNH func
Browse files Browse the repository at this point in the history
Memory is allocated for NHkey to check if mpls points to same
NH as in key list. Memory will now be freed after its use.

Change-Id: I03d542a3b4b1086ac52974615901bc4db480bc09
Closes-bug: #1615147
  • Loading branch information
ravi-bk committed Sep 2, 2016
1 parent 883dbcc commit 5e35a34
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vnsw/agent/oper/agent_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1304,9 +1304,8 @@ bool AgentPath::ReorderCompositeNH(Agent *agent,
//some other purpose. If it is so then ignore the request and wait for
//another update.
const NextHopKey *nh_key_1 = component_nh_key->nh_key();
const NextHopKey *nh_key_2 =
static_cast<const NextHopKey*>(mpls->nexthop()->
GetDBRequestKey().release());
DBEntryBase::KeyPtr key = mpls->nexthop()->GetDBRequestKey();
const NextHopKey *nh_key_2 = static_cast<const NextHopKey*>(key.get());
if (nh_key_1->IsEqual(*nh_key_2) == false) {
return false;
}
Expand Down

0 comments on commit 5e35a34

Please sign in to comment.