Skip to content

Commit

Permalink
[vlanmgrd] fix use-after-free memory issue (sonic-net#2211)
Browse files Browse the repository at this point in the history
* reordered the code so the reference to a deleted object (t) is not used
Signed-off-by: Yakiv Huryk <[email protected]>
  • Loading branch information
Yakiv-Huryk authored Mar 31, 2022
1 parent c2de7fc commit f4ec565
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cfgmgr/vlanmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ void VlanMgr::doVlanTask(Consumer &consumer)
*/
if (isVlanStateOk(key) && m_vlans.find(key) == m_vlans.end())
{
SWSS_LOG_DEBUG("%s already created", kfvKey(t).c_str());
m_vlans.insert(key);
m_vlanReplay.erase(kfvKey(t));
it = consumer.m_toSync.erase(it);
SWSS_LOG_DEBUG("%s already created", kfvKey(t).c_str());
continue;
}

Expand Down

0 comments on commit f4ec565

Please sign in to comment.