Commit 40100273 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 db3cfa8b
......@@ -400,8 +400,11 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
/* Target Cell, Neghibouring*/
Protocol__FlexNeighCellsMeasurements *neigh_meas;
neigh_meas = malloc(sizeof(Protocol__FlexNeighCellsMeasurements));
if (neigh_meas == NULL)
if (neigh_meas == NULL) {
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
protocol__flex_neigh_cells_measurements__init(neigh_meas);
......@@ -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);
if (eutra_meas == NULL) {
free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
goto error;
}
......@@ -426,6 +431,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
}
free(eutra_meas);
free(neigh_meas);
free(rrc_measurements);
rrc_measurements = NULL;
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