Commit 3d2b32ac authored by Guido Casati's avatar Guido Casati Committed by Guido Casati

Fix direct leak of memory allocate by deliver_sdu_srb with itti_malloc

* The RRC task is freeing the ITTI message but the message members that are allocated separetely still need to be freed

> Direct leak of 470 byte(s) in 6 object(s) allocated from:
    >0 0x7ffff74b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    >1 0x55555721f117 in itti_malloc /common/utils/ocp_itti/intertask_interface.cpp:64
    >2 0x555556f2356c in deliver_sdu_srb /openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c:775
    >3 0x555556f4e10e in nr_pdcp_entity_recv_pdu /openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c:184
    >4 0x555556f278ad in do_pdcp_data_ind /openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c:285
    >5 0x555556f278ad in pdcp_data_ind_thread /openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c:307
    >6 0x7ffff5e94ac2 in start_thread nptl/pthread_create.c:442
parent a59a69d5
......@@ -1793,6 +1793,9 @@ void *rrc_nrue(void *notUsed)
NR_RRC_DCCH_DATA_IND(msg_p).sdu_size,
NR_RRC_DCCH_DATA_IND(msg_p).gNB_index,
&NR_RRC_DCCH_DATA_IND(msg_p).msg_integrity);
/* this is allocated by itti_malloc in PDCP task (deliver_sdu_srb)
then passed to the RRC task and freed after use */
free(NR_RRC_DCCH_DATA_IND(msg_p).sdu_p);
break;
case NAS_KENB_REFRESH_REQ:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment