[asan][aclorch] fix a memory leak in the SaiAttrWrapper::swap()#2382
[asan][aclorch] fix a memory leak in the SaiAttrWrapper::swap()#2382prsunny merged 4 commits intosonic-net:masterfrom
Conversation
* fix a leak caused by overriding this->m_attr (which contained a dynamically allocated list) in the SaiAttrWrapper::swap() Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
|
@Yakiv-Huryk , is there any existing test that covers this part of the code? @theasianpianist , Is this due to optimization? |
Probably an optimization issue, looks like the method is being hit but the object code from the compiler does not line up exactly with the source code. |
|
/EasyCLA |
in this case can we merge it regardless? |
|
/easycla |
|
Merging as the diff coverage possibly is impacted by optimization. |
…c-net#2382) * fix a leak caused by overriding this->m_attr (which contained a dynamically allocated list) in the SaiAttrWrapper::swap()
fix a leak caused by overriding this->m_attr (which contained a dynamically allocated list) in the SaiAttrWrapper::swap()
ASAN report:
orchagent
What I did
Fixed the logic in the SaiAttrWrapper::swap()
Why I did it
To fix a memory leak
How I verified it
Run a DVS test with ASAN that found the bug
Details if related