Commit 7ddaa8ed authored by Dong Anyuan's avatar Dong Anyuan

Fix Coverity Scan CID 300489 (Variable neigh_meas going out of scope leaks the...

Fix Coverity Scan CID 300489 (Variable neigh_meas going out of scope leaks the storage it points to.)
parent 71191fb9
...@@ -412,8 +412,10 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -412,8 +412,10 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
if (neigh_meas->n_eutra_meas > 0){ if (neigh_meas->n_eutra_meas > 0){
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);
goto error; goto error;
}
for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){ for (int j = 0; j < neigh_meas->n_eutra_meas; j++ ){
...@@ -423,6 +425,7 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -423,6 +425,7 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
free(eutra_meas[k]); free(eutra_meas[k]);
} }
free(eutra_meas); free(eutra_meas);
free(neigh_meas);
goto error; goto error;
} }
...@@ -453,6 +456,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id, ...@@ -453,6 +456,8 @@ int flexran_agent_rrc_stats_reply(mid_t mod_id,
rrc_measurements->neigh_meas = neigh_meas; rrc_measurements->neigh_meas = neigh_meas;
} else {
free(neigh_meas);
} }
ue_report[i]->rrc_measurements = rrc_measurements; ue_report[i]->rrc_measurements = rrc_measurements;
......
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