mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 06:30:10 +00:00
[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:
@@ -674,6 +674,11 @@ public:
|
||||
*/
|
||||
explicit Client(Instance &aInstance);
|
||||
|
||||
/**
|
||||
* Destructor of `Client`
|
||||
*/
|
||||
~Client(void) { Stop(); }
|
||||
|
||||
/**
|
||||
* Starts the DNS client.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user