Commit 6c46f4a2 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for memory de-allocation for UE NGAP Context

parent 9ff8652c
......@@ -694,10 +694,14 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
// Store InitialUEMessage for Rereoute NAS later
if (unc.get()->initialUEMsg.buf) {
int encoded_size = 0;
init_ue_msg.initUeMsg->encode2buffer(
unc.get()->initialUEMsg.buf, encoded_size);
uint8_t* initial_ue_msg_buf = (uint8_t*) calloc(1, BUFFER_SIZE_1024);
int encoded_size = 0;
init_ue_msg.initUeMsg->encode2buffer(initial_ue_msg_buf, encoded_size);
if (encoded_size > 0) {
memcpy(
(void*) unc.get()->initialUEMsg.buf, (void*) initial_ue_msg_buf,
encoded_size);
comUt::print_buffer(
"ngap", "InitialUEMessage", unc.get()->initialUEMsg.buf,
encoded_size);
......
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