free memory to reduce the memory leaks

This commit is contained in:
laurent
2023-03-13 11:59:31 +01:00
parent 36783a3a79
commit a853a0873e
14 changed files with 54 additions and 39 deletions
@@ -187,7 +187,7 @@ int ngap_ue_context_release_req(instance_t instance,
ie->id = NGAP_ProtocolIE_ID_id_Cause;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_UEContextReleaseRequest_IEs__value_PR_Cause;
DevAssert(ue_release_req_p->cause <= NGAP_Cause_PR_choice_Extensions);
DevAssert(ue_release_req_p->cause <= NGAP_Cause_PR_choice_ExtensionS);
ie->value.choice.Cause.present = ue_release_req_p->cause;
ie->value.choice.Cause.choice.misc = ue_release_req_p->cause_value;
}
+1
View File
@@ -45,6 +45,7 @@ void ngap_gNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
sctp_data_req->freeAfterSend=true;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
+2 -1
View File
@@ -650,7 +650,8 @@ static void sctp_send_data(sctp_data_req_t *sctp_data_req_p)
/* TODO: notify upper layer */
return;
}
if ( sctp_data_req_p->freeAfterSend)
free(sctp_data_req_p->buffer);
SCTP_DEBUG("Successfully sent %u bytes on stream %d for assoc_id %u\n",
sctp_data_req_p->buffer_length, sctp_data_req_p->stream,
sctp_cnx->assoc_id);