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*/
|
/* 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,
|
|||||||
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,
|
|||||||
}
|
}
|
||||||
free(eutra_meas);
|
free(eutra_meas);
|
||||||
free(neigh_meas);
|
free(neigh_meas);
|
||||||
|
free(rrc_measurements);
|
||||||
|
rrc_measurements = NULL;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user