From e8ef2ca81989d980f65d6cc615dc5bb08e2c42bc Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Mon, 30 Dec 2019 16:31:09 -0800 Subject: [PATCH] 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 --- core/mac/src/pe/lim/lim_assoc_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 3c53a565dc02..2d627452ac17 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/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() ***/