wlan: Fixing memory leaks in roaming
There are memory leaks when an association fails while roaming. Ensure that
memory allocated is freed in case of failure or during clean-up.
Change-Id: Idf9543981b9977e19bf4da58c848a8752ebd6bfd
CRs-Fixed: 456763
diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c
index d1bee1a..84a4aaa 100644
--- a/CORE/MAC/src/pe/lim/limFT.c
+++ b/CORE/MAC/src/pe/lim/limFT.c
@@ -91,6 +91,11 @@
PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %p\n",
__func__, pMac->ft.ftPEContext.pFTPreAuthReq);)
#endif
+ if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription)
+ {
+ vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription);
+ pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL;
+ }
vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq);
pMac->ft.ftPEContext.pFTPreAuthReq = NULL;
}
@@ -150,6 +155,12 @@
PELOGE(limLog( pMac, LOGE, "%s: Freeing pFTPreAuthReq= %p\n",
__func__, pMac->ft.ftPEContext.pFTPreAuthReq);)
#endif
+ if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription)
+ {
+ vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription);
+ pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL;
+ }
+
vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq);
pMac->ft.ftPEContext.pFTPreAuthReq = NULL;
}