diff options
| author | Rakesh Sunki <rsunki@qca.qualcomm.com> | 2014-10-09 13:19:04 -0700 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-10-13 20:32:21 +0530 |
| commit | b739a246ebaac4e1c682ffe3655844b01793965b (patch) | |
| tree | 229e2f4c5c31e641b52e7e367f2db25a66d96089 | |
| parent | 87c7945653bc79d3fb5579e6bf160969fa86d96d (diff) | |
qcacld: Fix memory leak during scan process
Remove the double allocation of memroy for BSSID
and channelList of the scan profile. Allocate
the memory for BSSID and channelList only if it
is not allocated earlier from copy profile routine.
Change-Id: I0ed8afb942f87dc8f5319dae5e5193a1117a5344
CRs-Fixed: 735259
| -rw-r--r-- | CORE/SME/src/csr/csrNeighborRoam.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index 283417bfb9c2..d5662e3ad7ae 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -5922,12 +5922,17 @@ eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac, //Add the BSSID & Channel pProfile->BSSIDs.numOfBSSIDs = 1; - pProfile->BSSIDs.bssid = vos_mem_malloc(sizeof(tSirMacAddr) * pProfile->BSSIDs.numOfBSSIDs); + if (NULL == pProfile->BSSIDs.bssid) { - smsLog(pMac, LOGE, FL("mem alloc failed for BSSID")); - status = eHAL_STATUS_FAILURE; - break; + pProfile->BSSIDs.bssid = + vos_mem_malloc(sizeof(tSirMacAddr) * pProfile->BSSIDs.numOfBSSIDs); + if (NULL == pProfile->BSSIDs.bssid) + { + smsLog(pMac, LOGE, FL("mem alloc failed for BSSID")); + status = eHAL_STATUS_FAILURE; + break; + } } vos_mem_zero(pProfile->BSSIDs.bssid, sizeof(tSirMacAddr) * pProfile->BSSIDs.numOfBSSIDs); @@ -5940,14 +5945,17 @@ eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac, } pProfile->ChannelInfo.numOfChannels = 1; - pProfile->ChannelInfo.ChannelList = - vos_mem_malloc(sizeof(*pProfile->ChannelInfo.ChannelList) * - pProfile->ChannelInfo.numOfChannels); if (NULL == pProfile->ChannelInfo.ChannelList) { - smsLog(pMac, LOGE, FL("mem alloc failed for ChannelList")); - status = eHAL_STATUS_FAILURE; - break; + pProfile->ChannelInfo.ChannelList = + vos_mem_malloc(sizeof(*pProfile->ChannelInfo.ChannelList) * + pProfile->ChannelInfo.numOfChannels); + if (NULL == pProfile->ChannelInfo.ChannelList) + { + smsLog(pMac, LOGE, FL("mem alloc failed for ChannelList")); + status = eHAL_STATUS_FAILURE; + break; + } } pProfile->ChannelInfo.ChannelList[0] = pNeighborRoamInfo->handoffReqInfo.channel; |
