wlan: Fix pointer dereference KW issues in connect path
Fix KW issues which may cause pointer deference in multiple paths
Also check for memory allocation failures.
Change-Id: I852cb8a58703602fe9a127a822c900971d4bea4d
CRs-Fixed: 2197165
diff --git a/CORE/SYS/legacy/src/utils/src/parserApi.c b/CORE/SYS/legacy/src/utils/src/parserApi.c
index bf8458b..99833a4 100644
--- a/CORE/SYS/legacy/src/utils/src/parserApi.c
+++ b/CORE/SYS/legacy/src/utils/src/parserApi.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -5607,6 +5607,12 @@
{
tDot11fIERSN *pdot11f_rsn;
pdot11f_rsn = vos_mem_malloc(sizeof(tDot11fIERSN));
+ if (!pdot11f_rsn) {
+ dot11fLog(pmac, LOGE,
+ FL("Memory allocation failes for RSN IE"));
+ return;
+ }
+
vos_mem_set(pdot11f_rsn, sizeof(tDot11fIERSN), 0);
/* Assign RSN IE for Software AP Authentication offload security */
if (pmac->sap_auth_offload && pmac->sap_auth_offload_sec_type)