Sfoglia il codice sorgente

qcacld-3.0: Fix memory leak in csr_update_lost_link1_cmd

In function csr_update_lost_link1_cmd, memory is allocated to
local variable struct scan_filter, further we passing this
variable to csr_roam_prepare_filter_from_profile function and
allocating memory to the members of the scan_filter. At some
point in the function we are returning without freeing memory
allocated to scan_filter, which causes memory leak.

Make sure to free scan_filter’s memory before returning.

Change-Id: I448cf0d4bb16d4769b50c96495038684909e0739
CRs-Fixed: 1048116
Arif Hussain 8 anni fa
parent
commit
d3bf1115ef
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      core/sme/src/csr/csr_api_scan.c

+ 2 - 0
core/sme/src/csr/csr_api_scan.c

@@ -869,6 +869,8 @@ csr_update_lost_link1_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *cmd,
 				pSession->connectedProfile.operationChannel;
 			ch_info->numOfChannels = 1;
 		}
+		csr_free_scan_filter(mac_ctx, scan_filter);
+		qdf_mem_free(scan_filter);
 		return status;
 	}