Fixed memory management issues
This commit is contained in:
@@ -396,6 +396,9 @@ boolean_t pdcp_data_req(
|
|||||||
|
|
||||||
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p);
|
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p);
|
||||||
//rlc_status = ack_result;
|
//rlc_status = ack_result;
|
||||||
|
// free the memory for this block
|
||||||
|
free_mem_block(pdcp_pdu_p);
|
||||||
|
|
||||||
printf("Response is %u\n", ack_result_nikos);
|
printf("Response is %u\n", ack_result_nikos);
|
||||||
rlc_status = ack_result_nikos;
|
rlc_status = ack_result_nikos;
|
||||||
}
|
}
|
||||||
@@ -454,18 +457,6 @@ boolean_t pdcp_data_req(
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
//starting async
|
|
||||||
// const Enb_properties_array_t *enb_properties_p = NULL;
|
|
||||||
// Enb_properties_array_t *enb_properties_p = NULL;
|
|
||||||
// enb_properties_p = malloc(sizeof(Enb_properties_array_t));
|
|
||||||
// memset(enb_properties_p, 0, sizeof(Enb_properties_array_t));
|
|
||||||
// printf("starting the client\n\n");
|
|
||||||
|
|
||||||
// printf("Starting the async client\\n");
|
|
||||||
// new_thread(proto_server_start, NULL);
|
|
||||||
// enb_properties_p = enb_config_get();
|
|
||||||
|
|
||||||
// proto_agent_start(ctxt_pP->module_id, enb_properties_p);
|
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void *receive_thread(void *args) {
|
|||||||
LOG_E(PROTO_AGENT,"msg to send back is NULL\n");
|
LOG_E(PROTO_AGENT,"msg to send back is NULL\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
free(data);
|
//free(data);
|
||||||
|
|
||||||
if (msg != NULL){
|
if (msg != NULL){
|
||||||
if (proto_agent_msg_send(d->enb_id, PROTO_AGENT_DEFAULT, msg, size, priority)) {
|
if (proto_agent_msg_send(d->enb_id, PROTO_AGENT_DEFAULT, msg, size, priority)) {
|
||||||
@@ -373,12 +373,10 @@ proto_agent_send_rlc_data_req(const protocol_ctxt_t* const ctxt_pP, const srb_fl
|
|||||||
int msgsize = 0;
|
int msgsize = 0;
|
||||||
if (init_msg != NULL)
|
if (init_msg != NULL)
|
||||||
{
|
{
|
||||||
printf("Will pack the message\n");
|
|
||||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||||
|
|
||||||
printf("Will free the message\n");
|
|
||||||
free(init_msg);
|
|
||||||
|
|
||||||
LOG_I(PROTO_AGENT,"Server sending the pdcp data_req message over the async channel\n");
|
LOG_I(PROTO_AGENT,"Server sending the pdcp data_req message over the async channel\n");
|
||||||
|
|
||||||
if (msg!=NULL)
|
if (msg!=NULL)
|
||||||
@@ -441,7 +439,7 @@ proto_agent_send_pdcp_data_ind(const protocol_ctxt_t* const ctxt_pP, const srb_f
|
|||||||
printf("Will pack the message \n");
|
printf("Will pack the message \n");
|
||||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||||
printf("packed the message \n");
|
printf("packed the message \n");
|
||||||
free(init_msg);
|
//free(init_msg);
|
||||||
|
|
||||||
if (msg!=NULL)
|
if (msg!=NULL)
|
||||||
{
|
{
|
||||||
@@ -496,7 +494,7 @@ proto_server_receive(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
free(data);
|
//free(data);
|
||||||
|
|
||||||
ser_msg = proto_agent_pack_message(msg, &size);
|
ser_msg = proto_agent_pack_message(msg, &size);
|
||||||
}
|
}
|
||||||
@@ -554,7 +552,7 @@ proto_client_receive(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
free(data);
|
//free(data);
|
||||||
|
|
||||||
ser_msg = proto_agent_pack_message(msg, &size);
|
ser_msg = proto_agent_pack_message(msg, &size);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,13 +242,13 @@ int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg) {
|
|||||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG)
|
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
//free(msg->data_req_msg->header);
|
free(msg->data_req_msg->header);
|
||||||
//free(msg->data_req_msg->pdcp_data->fsp_pdu->fsp_pdu_data.data);
|
free(msg->data_req_msg->pdcp_data->fsp_pdu->fsp_pdu_data.data);
|
||||||
//free(msg->data_req_msg->pdcp_data->fsp_pdu);
|
free(msg->data_req_msg->pdcp_data->fsp_pdu);
|
||||||
//free(msg->data_req_msg->pdcp_data->fsp_ctxt);
|
free(msg->data_req_msg->pdcp_data->fsp_ctxt);
|
||||||
//free(msg->data_req_msg->pdcp_data);
|
free(msg->data_req_msg->pdcp_data);
|
||||||
//free(msg->data_req_msg);
|
free(msg->data_req_msg);
|
||||||
//free(msg);
|
free(msg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -355,6 +355,8 @@ int proto_agent_pdcp_data_req_ack(mid_t mod_id, const void *params, Protocol__Fl
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
if (pdcp_pdu_p != NULL)
|
||||||
|
free_mem_block(pdcp_pdu_p);
|
||||||
if(header != NULL)
|
if(header != NULL)
|
||||||
free(header);
|
free(header);
|
||||||
if(ack!=NULL)
|
if(ack!=NULL)
|
||||||
@@ -370,9 +372,9 @@ int proto_agent_destroy_pdcp_data_req_ack(Protocol__FlexsplitMessage *msg) {
|
|||||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_ACK)
|
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_ACK)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
//free(msg->data_req_ack->header);
|
free(msg->data_req_ack->header);
|
||||||
//free(msg->data_req_ack);
|
free(msg->data_req_ack);
|
||||||
//free(msg);
|
free(msg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -385,9 +387,9 @@ int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg) {
|
|||||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG)
|
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
//free(msg->data_req_ack->header);
|
free(msg->data_req_ack->header);
|
||||||
//free(msg->data_req_ack);
|
free(msg->data_req_ack);
|
||||||
//free(msg);
|
free(msg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -591,6 +593,9 @@ int proto_agent_pdcp_data_ind_ack(mid_t mod_id, const void *params, Protocol__Fl
|
|||||||
free(ack);
|
free(ack);
|
||||||
if(*msg != NULL)
|
if(*msg != NULL)
|
||||||
free(*msg);
|
free(*msg);
|
||||||
|
if (pdcp_pdu_p != NULL)
|
||||||
|
free_mem_block(pdcp_pdu_p);
|
||||||
|
|
||||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -601,9 +606,9 @@ int proto_agent_destroy_pdcp_data_ind_ack(Protocol__FlexsplitMessage *msg) {
|
|||||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_ACK)
|
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_ACK)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
//free(msg->data_req_ack->header);
|
free(msg->data_req_ack->header);
|
||||||
//free(msg->data_req_ack);
|
free(msg->data_req_ack);
|
||||||
//free(msg);
|
free(msg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -764,9 +769,9 @@ int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg) {
|
|||||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG)
|
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
//free(msg->echo_reply_msg->header);
|
free(msg->echo_reply_msg->header);
|
||||||
//free(msg->echo_reply_msg);
|
free(msg->echo_reply_msg);
|
||||||
//free(msg);
|
free(msg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|||||||
Reference in New Issue
Block a user