summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Dasari <dasaris@codeaurora.org>2020-04-12 18:07:28 +0530
committernshrivas <nshrivas@codeaurora.org>2020-04-18 06:32:41 -0700
commitf714c5f7b92fed193751a1f75ea4610ef8eff12b (patch)
tree9e9f63469c18ed4c4f6f7c407434a7a8e6e0f008
parentff201c5c275ae3827a7fdcfa0a61f9fa89dc85ef (diff)
qcacld-3.0: Fix possible memleak in send_assoc_req
Allocated a memory to hold the mbo IEs stripped from IEs received from userspace. But this buffer is not freed in all failure cases. Move the freeing to a common label "end" to free the buffer in all cases. Change-Id: I7ad268fed1898ac9f62e30eb4bd3740cce9bb4bc CRs-Fixed: 2662225
-rw-r--r--core/mac/src/pe/lim/lim_send_management_frames.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index c43755649217..87b5598c03de 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1953,7 +1953,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
mbo_ie, DOT11F_IE_MBO_IE_MAX_LEN);
if (sir_status != eSIR_SUCCESS) {
pe_err("Failed to strip MBO IE");
- goto free_mbo_ie;
+ goto end;
}
/* Include the EID and length fields */
@@ -2103,12 +2103,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx,
/* Pkt will be freed up by the callback */
goto end;
}
-
-free_mbo_ie:
- if (mbo_ie)
- qdf_mem_free(mbo_ie);
-
end:
+ qdf_mem_free(mbo_ie);
/* Free up buffer allocated for mlm_assoc_req */
qdf_mem_free(mlm_assoc_req);
mlm_assoc_req = NULL;