Dont free unhandled BDI message types
This commit is contained in:
parent
d721e90c1b
commit
73a0b06a04
|
|
@ -38,6 +38,7 @@
|
||||||
|
|
||||||
static int transport_indication(facilities_t *facilities, void* responder, uint8_t *msg, uint32_t msg_len) {
|
static int transport_indication(facilities_t *facilities, void* responder, uint8_t *msg, uint32_t msg_len) {
|
||||||
int rv = 0, code = 0;
|
int rv = 0, code = 0;
|
||||||
|
bool handled_msg = false;
|
||||||
FacilitiesDataIndication_t *fdi = NULL;
|
FacilitiesDataIndication_t *fdi = NULL;
|
||||||
|
|
||||||
BTPDataIndication_t *bdi = calloc(1, sizeof(BTPDataIndication_t));
|
BTPDataIndication_t *bdi = calloc(1, sizeof(BTPDataIndication_t));
|
||||||
|
|
@ -61,14 +62,17 @@ static int transport_indication(facilities_t *facilities, void* responder, uint8
|
||||||
case Port_cam:
|
case Port_cam:
|
||||||
its_msg_descriptor = &asn_DEF_CAM;
|
its_msg_descriptor = &asn_DEF_CAM;
|
||||||
its_msg = calloc(1, sizeof(CAM_t));
|
its_msg = calloc(1, sizeof(CAM_t));
|
||||||
|
handled_msg = true;
|
||||||
break;
|
break;
|
||||||
case Port_denm:
|
case Port_denm:
|
||||||
its_msg_descriptor = &asn_DEF_DENM;
|
its_msg_descriptor = &asn_DEF_DENM;
|
||||||
its_msg = calloc(1, sizeof(DENM_t));
|
its_msg = calloc(1, sizeof(DENM_t));
|
||||||
|
handled_msg = true;
|
||||||
break;
|
break;
|
||||||
case Port_ivim:
|
case Port_ivim:
|
||||||
its_msg_descriptor = &asn_DEF_IVIM;
|
its_msg_descriptor = &asn_DEF_IVIM;
|
||||||
its_msg = calloc(1, sizeof(IVIM_t));
|
its_msg = calloc(1, sizeof(IVIM_t));
|
||||||
|
handled_msg = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
syslog_debug("[facilities] messsage with unhandled BTP port received, ignoring");
|
syslog_debug("[facilities] messsage with unhandled BTP port received, ignoring");
|
||||||
|
|
@ -134,7 +138,7 @@ static int transport_indication(facilities_t *facilities, void* responder, uint8
|
||||||
pthread_cond_signal(&facilities->tx_queue->trigger);
|
pthread_cond_signal(&facilities->tx_queue->trigger);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (bdi->destinationPort != Port_denm && bdi->destinationPort != Port_ivim) {
|
if (handled_msg && bdi->destinationPort != Port_denm && bdi->destinationPort != Port_ivim) {
|
||||||
ASN_STRUCT_FREE(*its_msg_descriptor, its_msg);
|
ASN_STRUCT_FREE(*its_msg_descriptor, its_msg);
|
||||||
}
|
}
|
||||||
ASN_STRUCT_FREE(asn_DEF_BTPDataIndication, bdi);
|
ASN_STRUCT_FREE(asn_DEF_BTPDataIndication, bdi);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue