mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 14:47:46 +00:00
[srp-server] free heap allocated data from Free() (#7165)
This commit fixes the potential memory leak of `mTxtData` when a `Description` instance is freed. Also addresses similar situation with `mServiceName` when `Service` instance is freed.
This commit is contained in:
@@ -1469,6 +1469,7 @@ exit:
|
||||
|
||||
void Server::Service::Free(void)
|
||||
{
|
||||
mServiceName.Free();
|
||||
Heap::Free(this);
|
||||
}
|
||||
|
||||
@@ -1619,6 +1620,7 @@ exit:
|
||||
void Server::Service::Description::Free(void)
|
||||
{
|
||||
mInstanceName.Free();
|
||||
Heap::Free(mTxtData);
|
||||
Heap::Free(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user