Commit c6e389ed authored by Robert Schmidt's avatar Robert Schmidt

FlexRAN: assert if out of memory

parent a87220d3
...@@ -693,8 +693,7 @@ int flexran_agent_mac_stats_reply_cell(mid_t mod_id, ...@@ -693,8 +693,7 @@ int flexran_agent_mac_stats_reply_cell(mid_t mod_id,
// TODO: Fill in the actual noise and interference report for this cell // TODO: Fill in the actual noise and interference report for this cell
Protocol__FlexNoiseInterferenceReport *ni_report; Protocol__FlexNoiseInterferenceReport *ni_report;
ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport)); ni_report = malloc(sizeof(Protocol__FlexNoiseInterferenceReport));
if(ni_report == NULL) AssertFatal(ni_report, "cannot malloc() ni_report\n");
goto error;
protocol__flex_noise_interference_report__init(ni_report); protocol__flex_noise_interference_report__init(ni_report);
ni_report->sfn_sf = flexran_get_sfn_sf(mod_id); ni_report->sfn_sf = flexran_get_sfn_sf(mod_id);
ni_report->has_sfn_sf = 1; ni_report->has_sfn_sf = 1;
...@@ -709,21 +708,6 @@ int flexran_agent_mac_stats_reply_cell(mid_t mod_id, ...@@ -709,21 +708,6 @@ int flexran_agent_mac_stats_reply_cell(mid_t mod_id,
} }
} }
return 0; return 0;
error:
if (cell_report != NULL) {
if (n_cc > 0) {
for (int i = 0; i < n_cc; i++) {
if (cell_report[i]->noise_inter_report != NULL) {
free(cell_report[i]->noise_inter_report);
cell_report[i]->noise_inter_report = NULL;
}
}
}
free(cell_report);
cell_report = NULL;
}
return -1;
} }
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexStatsReply *reply) { int flexran_agent_mac_destroy_stats_reply(Protocol__FlexStatsReply *reply) {
......
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