internet: fix Valgrind issue in 5d4fc177ab

This commit is contained in:
Tommaso Pecorella
2025-09-28 11:32:33 +02:00
committed by Tommaso Pecorella
parent e2c56f2331
commit 324f5bd48c
2 changed files with 10 additions and 2 deletions

View File

@@ -88,7 +88,11 @@ void
ArpCache::DoDispose()
{
NS_LOG_FUNCTION(this);
Flush();
for (auto& iter : m_arpCache)
{
delete iter.second; /* delete the pointer ArpCache::Entry */
}
m_arpCache.clear();
m_device = nullptr;
m_interface = nullptr;
if (!m_waitReplyTimer.IsPending())

View File

@@ -53,7 +53,11 @@ void
NdiscCache::DoDispose()
{
NS_LOG_FUNCTION(this);
Flush();
for (auto& iter : m_ndCache)
{
delete iter.second; /* delete the pointer NdiscCache::Entry */
}
m_ndCache.clear();
m_device = nullptr;
m_interface = nullptr;
m_icmpv6 = nullptr;