diff --git a/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp b/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp index 96d869453fd02c..0d9115d6c98e53 100644 --- a/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp +++ b/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp @@ -300,6 +300,7 @@ void AdvertiserMinMdns::Clear() CHIP_ERROR AdvertiserMinMdns::Advertise(const OperationalAdvertisingParameters & params) { + Clear(); char nameBuffer[64] = ""; /// need to set server name @@ -363,6 +364,7 @@ CHIP_ERROR AdvertiserMinMdns::Advertise(const OperationalAdvertisingParameters & CHIP_ERROR AdvertiserMinMdns::Advertise(const CommissionAdvertisingParameters & params) { + Clear(); // TODO: need to detect colisions here char nameBuffer[64] = ""; size_t len = snprintf(nameBuffer, sizeof(nameBuffer), ChipLogFormatX64, GetRandU32(), GetRandU32());