Fix Coverity Scan CID 300384 (Variable rrc_measurements going out of scope leaks the storage it points to.)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user