Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28617c6b authored by Bala Venkatesh's avatar Bala Venkatesh Committed by nshrivas
Browse files

cld-3.0: Avoid memory leaks

Free allocated memory in error cases before
returning from functions csr_roam_sort_channel_for_early_stop
and csr_roam_issue_ft_preauth_req.

Change-Id: I22501dce8cfa54bf98b451ba209da7abea01fc79
CRs-Fixed: 2464838
parent f3c37cb5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -847,7 +847,7 @@ static void csr_roam_sort_channel_for_early_stop(tpAniSirGlobal mac_ctx,
	if (!chan_list_greedy || !chan_list_non_greedy) {
		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
			  "Failed to allocate memory for tSirUpdateChanList");
		return;
		goto scan_list_sort_error;
	}
	/*
	 * fixed_greedy_chan_list is an evaluated channel list based on most of
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019 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
@@ -537,6 +537,7 @@ QDF_STATUS csr_roam_issue_ft_preauth_req(tpAniSirGlobal mac_ctx,
				+ bss_desc->length);
	if (NULL == preauth_req->pbssDescription) {
		sme_err("Memory allocation for FT Preauth request failed");
		qdf_mem_free(preauth_req);
		return QDF_STATUS_E_NOMEM;
	}