Ver Fonte

qcacld-3.0: Free limAssocResponseData before assigning assoc_rsp

When do continuous reassociation test, It's needed to free
session_entry->limAssocResponseData first before assigning
new assoc_rsp, otherwise all previous allocated assoc_rsp
don't have chances to be freed except the last reassocation,
and memory leak will be detected.

Change-Id: Icf9056369b5f1d390b1393d5942cefe116d03417
CRs-Fixed: 3419762
Qun Zhang há 2 anos atrás
pai
commit
114f58739f
1 ficheiros alterados com 9 adições e 0 exclusões
  1. 9 0
      core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

+ 9 - 0
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -1315,6 +1315,15 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 			session_entry->pLimMlmJoinReq = NULL;
 		}
 
+		if (session_entry->limAssocResponseData) {
+			tpSirAssocRsp pre_assoc_rsp;
+
+			pre_assoc_rsp = (tpSirAssocRsp)
+					session_entry->limAssocResponseData;
+			qdf_mem_free(pre_assoc_rsp->sha384_ft_subelem.gtk);
+			qdf_mem_free(pre_assoc_rsp->sha384_ft_subelem.igtk);
+			qdf_mem_free(session_entry->limAssocResponseData);
+		}
 		session_entry->limAssocResponseData = (void *)assoc_rsp;
 		/*
 		 * Store the ReAssocRsp Frame in DphTable