From d3bf1115ef40c9b5d94718d8c51bfa12e75c5c6f Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Fri, 29 Jul 2016 10:16:53 -0700 Subject: [PATCH] qcacld-3.0: Fix memory leak in csr_update_lost_link1_cmd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In function csr_update_lost_link1_cmd, memory is allocated to local variable struct scan_filter, further we passing this variable to csr_roam_prepare_filter_from_profile function and allocating memory to the members of the scan_filter. At some point in the function we are returning without freeing memory allocated to scan_filter, which causes memory leak. Make sure to free scan_filter’s memory before returning. Change-Id: I448cf0d4bb16d4769b50c96495038684909e0739 CRs-Fixed: 1048116 --- core/sme/src/csr/csr_api_scan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 3967119f1e4f..6f960e26be16 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -869,6 +869,8 @@ csr_update_lost_link1_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *cmd, pSession->connectedProfile.operationChannel; ch_info->numOfChannels = 1; } + csr_free_scan_filter(mac_ctx, scan_filter); + qdf_mem_free(scan_filter); return status; }