Fix Coverity Scan CID 300506 (Variable full_ul_report going out of scope leaks the storage it points to.)

This commit is contained in:
Dong Anyuan
2019-05-28 21:04:15 +09:00
parent a4a51eb9c7
commit ddb9b21878
@@ -303,6 +303,20 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi
return full_ul_report;
error:
if (full_ul_report){
if (ul_report){
for (i = 0; i < full_ul_report->n_cqi_meas; i++){
if (ul_report[i]){
if ( ul_report[i]->sinr ){
free(ul_report[i]->sinr);
}
free(ul_report[i]);
}
}
free(ul_report);
}
free(full_ul_report);
}
return NULL;
}