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

This commit is contained in:
Dong Anyuan
2019-05-28 21:16:57 +09:00
parent 130c8d3da0
commit c3854df16e
@@ -185,8 +185,10 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
//Create the actual CSI reports.
Protocol__FlexDlCsi **csi_reports;
csi_reports = malloc(sizeof(Protocol__FlexDlCsi *)*dl_report->n_csi_report);
if (csi_reports == NULL)
if (csi_reports == NULL) {
free(dl_report);
goto error;
}
for (j = 0; j < dl_report->n_csi_report; j++) {
csi_reports[j] = malloc(sizeof(Protocol__FlexDlCsi));