[dns-client] add destructor to ensure proper cleanup (#12026)

Adds a destructor to the `Dns::Client` class to ensure that `Stop()`
is called when a `Client` object is destroyed (freeing all allocated
queries).

This change prevents false memory leak reports from fuzzer tests when
an `ot::Instance` is destroyed during ongoing DNS queries (retries).
This commit is contained in:
Abtin Keshavarzian
2025-10-13 15:02:31 +02:00
committed by GitHub
parent a9d1103d41
commit 1f20dbc0af
+5
View File
@@ -674,6 +674,11 @@ public:
*/
explicit Client(Instance &aInstance);
/**
* Destructor of `Client`
*/
~Client(void) { Stop(); }
/**
* Starts the DNS client.
*