mirror of
https://github.com/espressif/openthread.git
synced 2026-11-05 22:13:36 +00:00
[core] do not use FreeMessageOnError() on nonnull pointer (#8118)
This commit is contained in:
@@ -219,10 +219,10 @@ void Server::SendResponse(Header aHeader,
|
||||
|
||||
error = aSocket.SendTo(aMessage, aMessageInfo);
|
||||
|
||||
FreeMessageOnError(&aMessage, error);
|
||||
|
||||
if (error != kErrorNone)
|
||||
{
|
||||
// do not use `FreeMessageOnError()` to avoid null check on nonnull pointer
|
||||
aMessage.Free();
|
||||
LogWarn("failed to send DNS-SD reply: %s", ErrorToString(error));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1640,7 +1640,11 @@ void Mle::SendDelayedResponse(TxMessage &aMessage, const DelayedResponseMetadata
|
||||
}
|
||||
|
||||
exit:
|
||||
FreeMessageOnError(&aMessage, error);
|
||||
if (error != kErrorNone)
|
||||
{
|
||||
// do not use `FreeMessageOnError()` to avoid null check on nonnull pointer
|
||||
aMessage.Free();
|
||||
}
|
||||
}
|
||||
|
||||
void Mle::RemoveDelayedDataResponseMessage(void)
|
||||
|
||||
Reference in New Issue
Block a user