Merge pull request #3787 from GUVWAF/ccToPhoneErr

Check if packet is not released before CC to phone
This commit is contained in:
Thomas Göttgens 2024-05-05 16:47:11 +02:00 committed by GitHub
commit e9ebdfeff2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -257,7 +257,7 @@ void MeshService::sendToMesh(meshtastic_MeshPacket *p, RxSource src, bool ccToPh
LOG_DEBUG("Can't send status to phone");
}
if (ccToPhone) {
if (res == ERRNO_OK && ccToPhone) { // Check if p is not released in case it couldn't be sent
sendToPhone(packetPool.allocCopy(*p));
}
}