From c3854df16ed03057549fb3437ca18811beed2508 Mon Sep 17 00:00:00 2001 From: Dong Anyuan Date: Tue, 28 May 2019 21:16:57 +0900 Subject: [PATCH] Fix Coverity Scan CID 300478 (Variable dl_report going out of scope leaks the storage it points to.) --- openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c index 257cd444e2..d19399e256 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -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));