Commit 5877ee80 authored by DONG Anyuan's avatar DONG Anyuan

Fix Coverity Scan CID 300421 (Variable eutra_meas going out of scope leaks the...

Fix Coverity Scan CID 300421 (Variable eutra_meas going out of scope leaks the storage it points to.)
parent 542bd49c
......@@ -409,8 +409,13 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){
eutra_meas[j] = malloc(sizeof(Protocol__FlexEutraMeasurements));
if (eutra_meas[j] == NULL)
if (eutra_meas[j] == NULL) {
for (int k = 0 ; k < j ; k++) {
free(eutra_meas[k]);
}
free(eutra_meas);
goto error;
}
protocol__flex_eutra_measurements__init(eutra_meas[j]);
......
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