Ver Fonte

qcacld-3.0: Fix memory leak while populating the peer rate set

Fix the possible memory leak while populating the peer rate set

Change-Id: I9d16c0c4a9e6ead4b82c1112333e11aa6379c7de
CRs-Fixed: 2593986
Kiran Kumar Lokere há 5 anos atrás
pai
commit
e8ef2ca819
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      core/mac/src/pe/lim/lim_assoc_utils.c

+ 4 - 1
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -1797,7 +1797,7 @@ QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
 	tDot11fIEhe_cap *peer_he_caps;
 	struct bss_description *bssDescription =
 		&pe_session->lim_join_req->bssDescription;
-	tSchBeaconStruct *pBeaconStruct;
+	tSchBeaconStruct *pBeaconStruct = NULL;
 
 	/* copy operational rate set from pe_session */
 	if (pe_session->rateSet.numRates <= WLAN_SUPPORTED_RATES_IE_MAX_LEN) {
@@ -1952,6 +1952,9 @@ QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
 	}
 	pe_debug("nss: %d", pe_session->nss);
 
+	if (pBeaconStruct)
+		qdf_mem_free(pBeaconStruct);
+
 	return QDF_STATUS_SUCCESS;
 } /*** lim_populate_peer_rate_set() ***/