mesh: don't free outgoing network pdus in mesh_network (owned by higher layer)

This commit is contained in:
Matthias Ringwald 2019-09-18 15:38:17 +02:00
parent 84242f8829
commit 88fa182f58

View File

@ -1148,22 +1148,19 @@ void mesh_network_reset(void){
mesh_network_reset_network_pdus(&network_pdus_queued);
mesh_network_reset_network_pdus(&network_pdus_outgoing_gatt);
mesh_network_reset_network_pdus(&network_pdus_outgoing_adv);
// outgoing network pdus are owned by higher layer, so we don't free:
// - adv_bearer_network_pdu
// - gatt_bearer_network_pdu
// - outoing_pdu
#ifdef ENABLE_MESH_ADV_BEARER
if (adv_bearer_network_pdu){
mesh_network_pdu_free(adv_bearer_network_pdu);
adv_bearer_network_pdu = NULL;
}
adv_bearer_network_pdu = NULL;
#endif
#ifdef ENABLE_MESH_GATT_BEARER
if (gatt_bearer_network_pdu){
mesh_network_pdu_free(gatt_bearer_network_pdu);
gatt_bearer_network_pdu = NULL;
}
gatt_bearer_network_pdu = NULL;
#endif
if (outgoing_pdu){
mesh_network_pdu_free(outgoing_pdu);
outgoing_pdu = NULL;
}
outgoing_pdu = NULL;
if (incoming_pdu_raw){
mesh_network_pdu_free(incoming_pdu_raw);
incoming_pdu_raw = NULL;