From f7387bda9cbb977e56a22ae7f04b4477cd180e03 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Mon, 6 Nov 2017 15:48:01 -0800 Subject: [PATCH] qcacld-3.0: Fix memory leak while handling deauth req's error case When caller calls lim_process_mlm_deauth_req() API, it checks for session's validity before passing it forward. If session is found to be invalid then it is returning immediately without releasing the memory. Caller is expecting this API to release the memory in any error cases. Release the memory before returning to caller in error case. CRs-Fixed: 2138983 Change-Id: I800d717cd22a6e2731ef211743e4844852a132a3 --- core/mac/src/pe/lim/lim_process_mlm_req_messages.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index d64d6913cf67..b53feb885212 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -1888,6 +1888,7 @@ lim_process_mlm_deauth_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) if (NULL == session) { pe_err("session does not exist for given sessionId %d", mlm_deauth_req->sessionId); + qdf_mem_free(mlm_deauth_req); return; } lim_process_mlm_deauth_req_ntf(mac_ctx, QDF_STATUS_SUCCESS,