mesh: free pending outgoing pdus

This commit is contained in:
Matthias Ringwald 2020-08-21 18:56:11 +02:00
parent 2908c9e636
commit 213a3171cf

View File

@ -1226,12 +1226,22 @@ void mesh_network_reset(void){
// - adv_bearer_network_pdu
// - gatt_bearer_network_pdu
// - outoing_pdu
// unless they are SEG ACK messages
#ifdef ENABLE_MESH_ADV_BEARER
if ((adv_bearer_network_pdu != NULL) && (adv_bearer_network_pdu->pdu_header.pdu_type == MESH_PDU_TYPE_SEGMENT_ACKNOWLEDGMENT)){
btstack_memory_mesh_network_pdu_free(adv_bearer_network_pdu);
}
adv_bearer_network_pdu = NULL;
#endif
#ifdef ENABLE_MESH_GATT_BEARER
if ((gatt_bearer_network_pdu != NULL) && (gatt_bearer_network_pdu->pdu_header.pdu_type == MESH_PDU_TYPE_SEGMENT_ACKNOWLEDGMENT)){
btstack_memory_mesh_network_pdu_free(gatt_bearer_network_pdu);
}
gatt_bearer_network_pdu = NULL;
#endif
if ((outgoing_pdu != NULL) && (outgoing_pdu->pdu_header.pdu_type == MESH_PDU_TYPE_SEGMENT_ACKNOWLEDGMENT)){
btstack_memory_mesh_network_pdu_free(outgoing_pdu);
}
outgoing_pdu = NULL;
if (incoming_pdu_raw){