[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:
Abtin Keshavarzian
2021-11-15 10:17:58 -08:00
committed by GitHub
parent b4ac18a273
commit 88d946cc08
+2
View File
@@ -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);
}