Commit 06b70810 authored by Dong Anyuan's avatar Dong Anyuan

Fix Coverity Scan CID 300384 (Variable rrc_measurements going out of scope...

Fix Coverity Scan CID 300384 (Variable rrc_measurements going out of scope leaks the storage it points to.)
parent 34dc71b2
...@@ -400,8 +400,11 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -400,8 +400,11 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
/* Target Cell, Neghibouring*/ /* Target Cell, Neghibouring*/
Protocol__FlexNeighCellsMeasurements *neigh_meas; Protocol__FlexNeighCellsMeasurements *neigh_meas;
neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements)); neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements));
if (neigh_meas == NULL) if (neigh_meas == NULL) {
free(rrc_measurements);
rrc_measurements = NULL;
goto error; goto error;
}
protocol__flex_neigh_cells_measurements__init(neigh_meas); protocol__flex_neigh_cells_measurements__init(neigh_meas);
...@@ -414,6 +417,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -414,6 +417,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas); eutra_meas = malloc(sizeof(Protocol__FlexEutraMeasurements) * neigh_meas->n_eutra_meas);
if (eutra_meas == NULL) { if (eutra_meas == NULL) {
free(neigh_meas); free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error; goto error;
} }
...@@ -426,6 +431,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -426,6 +431,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
} }
free(eutra_meas); free(eutra_meas);
free(neigh_meas); free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error; goto error;
} }
......
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