Fix: memory leak occurs when memblock is exhausted.

(cherry picked from commit 0e550a32e46d797d03fd72e54e474762d4db7614)

# Conflicts:
#	openair2/LAYER2/RLC/rlc.c
This commit is contained in:
Haruki NAOI
2018-03-26 19:32:11 +09:00
parent 5646b07870
commit 8f86f38d58
4 changed files with 7 additions and 0 deletions
+1
View File
@@ -509,6 +509,7 @@ rlc_am_rx (
default:
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" TX UNKNOWN PROTOCOL STATE 0x%02X\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP, rlc), rlc->protocol_state);
list_free (&data_indP.data);
}
}
+1
View File
@@ -421,6 +421,7 @@ rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind
LOG_E(RLC, PROTOCOL_RLC_UM_CTXT_FMT" TX UNKNOWN PROTOCOL STATE %02X hex\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p),
l_rlc_p->protocol_state);
list_free (&data_indP.data);
}
}
+4
View File
@@ -441,6 +441,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
return RLC_OP_STATUS_OK;
} else {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
free_mem_block(sdu_pP, __func__);
return RLC_OP_STATUS_INTERNAL_ERROR;
}
@@ -465,6 +466,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
return RLC_OP_STATUS_OK;
} else {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
free_mem_block(sdu_pP, __func__);
return RLC_OP_STATUS_INTERNAL_ERROR;
}
@@ -487,6 +489,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
} else {
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : out of memory\n", __FILE__, __LINE__);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
free_mem_block(sdu_pP, __func__);
return RLC_OP_STATUS_INTERNAL_ERROR;
}
@@ -521,6 +524,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
return RLC_OP_STATUS_OK;
} else {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
free_mem_block(sdu_pP, __func__);
return RLC_OP_STATUS_BAD_PARAMETER;
}
} else {
+1
View File
@@ -299,6 +299,7 @@ void mac_rlc_data_ind (
switch (rlc_mode) {
case RLC_MODE_NONE:
//handle_event(WARNING,"FILE %s FONCTION mac_rlc_data_ind() LINE %s : no radio bearer configured :%d\n", __FILE__, __LINE__, channel_idP);
list_free (&data_ind.data);
break;
case RLC_MODE_AM: