summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangq <zhangq@qti.qualcomm.com>2016-04-12 13:18:50 +0800
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-05-05 15:47:08 +0530
commit586c68741a019ef14cf17dd45c00f4c73c8aaffe (patch)
tree6089974cdf39324b5bf6cb2ca52347d4b5ba6c6d
parentfa6fc7d4e0888f2a3d9975b4bfd508e5f57a2a66 (diff)
qcacld-2.0: Resolve memory leakage in limAssocUtils.c
There is potential memory leakage in limStaSendAddBss(). pAddBssParams should be released once failed to look up a STA state node in hash table. In limAddSta(), there is another potential memory leakage once failed to find a IBSS peer. Change-Id: I28ecb1f5a449e3d471798185fd30ec38563b34de CRs-Fixed: 1002063
-rw-r--r--CORE/MAC/src/pe/lim/limAssocUtils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c
index 1e1843f1e5f4..1f18d9a5b303 100644
--- a/CORE/MAC/src/pe/lim/limAssocUtils.c
+++ b/CORE/MAC/src/pe/lim/limAssocUtils.c
@@ -2574,6 +2574,7 @@ limAddSta(
pPeerNode = limIbssPeerFind(pMac, *pStaAddr);
if (!pPeerNode) {
limLog( pMac, LOGP, FL("Can't find IBSS peer node for ADD_STA"));
+ vos_mem_free(pAddStaParams);
return eSIR_HAL_STA_DOES_NOT_EXIST;
}
@@ -3764,7 +3765,7 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
{
tSirMsgQ msgQ;
tpAddBssParams pAddBssParams = NULL;
- tANI_U32 retCode;
+ tSirRetStatus retCode = eSIR_SUCCESS;
tANI_U8 i;
tpDphHashNode pStaDs = NULL;
tANI_U8 chanWidthSupp = 0;
@@ -3963,7 +3964,8 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
PELOGE(limLog(pMac, LOGE, FL("Couldn't get assoc id for "
"MAC ADDR: " MAC_ADDRESS_STR),
MAC_ADDR_ARRAY(pAddBssParams->staContext.staMac));)
- return eSIR_FAILURE;
+ retCode = eSIR_FAILURE;
+ goto returnFailure;
}
if(!pMac->psOffloadEnabled)
@@ -4288,7 +4290,6 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
if( eSIR_SUCCESS != retCode)
{
SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
- vos_mem_free(pAddBssParams);
limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"),
retCode );
goto returnFailure;
@@ -4298,6 +4299,8 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
return retCode;
returnFailure:
+ if (pAddBssParams != NULL)
+ vos_mem_free(pAddBssParams);
// Clean-up will be done by the caller...
return retCode;
}