summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin Ahuja <sahuja@qti.qualcomm.com>2014-07-09 22:05:55 +0530
committerPitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com>2014-08-07 12:46:38 +0530
commitb5208aeb5b8dda8e7ee5b0ab5cf1b4070da8ad14 (patch)
treebabb0f46120e33b44da8808621488baf4194591f
parentb1fc2f24f45783ed0dcbd27374f9542546055e34 (diff)
wlan: Avoid memory leak when SAP receives Assoc Req from STA
Currently in SAP mode when Auth request is received from connected STA, driver sends the disassoc. Before the STA context is deleted, STA sends the Assoc request, so driver allocates the memory for assoc frame which is not freed. This leads to memory leak.Fix that. Change-Id: Iaab873826cbebcb6ac3dfc46720c369cf6dd4181 CRs-Fixed: 690190
-rw-r--r--CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c
index 4f8404ef1701..b8877ae17dad 100644
--- a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c
@@ -183,7 +183,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
tAniAuthType authType;
tSirMacCapabilityInfo localCapabilities;
tpDphHashNode pStaDs = NULL;
- tpSirAssocReq pAssocReq;
+ tpSirAssocReq pAssocReq, pTempAssocReq;
tLimMlmStates mlmPrevState;
tDot11fIERSN Dot11fIERSN;
tDot11fIEWPA Dot11fIEWPA;
@@ -1057,8 +1057,29 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,
sendIndToSme:
+ /*
+ * check here if the parsedAssocReq already
+ * pointing to the AssocReq and free it before
+ * assigning this new pAssocReq
+ */
+ if (psessionEntry->parsedAssocReq != NULL)
+ {
+ pTempAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId];
+ if (pTempAssocReq != NULL)
+ {
+ if (pTempAssocReq->assocReqFrame)
+ {
+ vos_mem_free(pTempAssocReq->assocReqFrame);
+ pTempAssocReq->assocReqFrame = NULL;
+ pTempAssocReq->assocReqFrameLength = 0;
+ }
+ vos_mem_free(pTempAssocReq);
+ pTempAssocReq = NULL;
+ }
+
+ psessionEntry->parsedAssocReq[pStaDs->assocId] = pAssocReq;
+ }
- psessionEntry->parsedAssocReq[pStaDs->assocId] = pAssocReq;
pStaDs->mlmStaContext.htCapability = pAssocReq->HTCaps.present;
#ifdef WLAN_FEATURE_11AC