[mesh-forwarder] use RemoveMessageIfNoPendingTx() on direct tx fails (#10471)

This commit updates `PrepareNextDirectTransmission()` to use
`RemoveMessageIfNoPendingTx()` if a message cannot be prepared for
direct transmission. This ensures the message is not dequeued and
freed if it is also queued for indirect transmission.
This commit is contained in:
Abtin Keshavarzian
2024-07-03 15:19:03 -07:00
committed by GitHub
parent be79db724d
commit e7837eb104
+1 -1
View File
@@ -654,7 +654,7 @@ Message *MeshForwarder::PrepareNextDirectTransmission(void)
#endif
LogMessage(kMessageDrop, *curMessage, error);
FinalizeMessageDirectTx(*curMessage, error);
mSendQueue.DequeueAndFree(*curMessage);
RemoveMessageIfNoPendingTx(*curMessage);
continue;
}
}