diff options
| author | Bala Venkatesh <bjavvaji@codeaurora.org> | 2019-06-06 11:25:47 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2019-06-06 11:39:26 -0700 |
| commit | e573d783dcc923c47aab4cd4bbc87c0bf7f024ee (patch) | |
| tree | d5c6b26214989984504eefc5c3b5e7c747cf22a6 | |
| parent | 65c226e24403bbc4d588cfdae430c3491ba0e652 (diff) | |
qcacld-3.0: Avoid memory leaks
pScanFilter->BSSIDs.numOfBSSIDs is allocated as part
of function csr_neighbor_roam_prepare_scan_profile_filter
and this memory is not freed in error cases.
Hence free the allocated memory of pScanFilter->BSSIDs.numOfBSSIDs
in error cases before returning from function
csr_neighbor_roam_prepare_scan_profile_filter.
Change-Id: I411dba7ead796f84994e633a387730de6ee4d579
CRs-Fixed: 2464822
| -rw-r--r-- | core/sme/src/csr/csr_neighbor_roam.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 274c8c3f5494..5449d5d98115 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -397,6 +397,8 @@ csr_neighbor_roam_prepare_scan_profile_filter(tpAniSirGlobal pMac, pScanFilter->SSIDs.numOfSSIDs); if (NULL == pScanFilter->SSIDs.SSIDList) { sme_err("Scan Filter SSID mem alloc failed"); + qdf_mem_free(pScanFilter->BSSIDs.bssid); + pScanFilter->BSSIDs.bssid = NULL; return QDF_STATUS_E_NOMEM; } for (i = 0; i < roam_params->num_ssid_allowed_list; i++) { @@ -416,6 +418,8 @@ csr_neighbor_roam_prepare_scan_profile_filter(tpAniSirGlobal pMac, qdf_mem_malloc(sizeof(tCsrSSIDInfo)); if (NULL == pScanFilter->SSIDs.SSIDList) { sme_err("Scan Filter SSID mem alloc failed"); + qdf_mem_free(pScanFilter->BSSIDs.bssid); + pScanFilter->BSSIDs.bssid = NULL; return QDF_STATUS_E_NOMEM; } pScanFilter->SSIDs.SSIDList->handoffPermitted = 1; @@ -456,6 +460,8 @@ csr_neighbor_roam_prepare_scan_profile_filter(tpAniSirGlobal pMac, qdf_mem_malloc(num_ch * sizeof(uint8_t)); if (NULL == pScanFilter->ChannelInfo.ChannelList) { sme_err("Scan Filter Ch list mem alloc failed"); + qdf_mem_free(pScanFilter->BSSIDs.bssid); + pScanFilter->BSSIDs.bssid = NULL; qdf_mem_free(pScanFilter->SSIDs.SSIDList); pScanFilter->SSIDs.SSIDList = NULL; return QDF_STATUS_E_NOMEM; |
