Jelajahi Sumber

qcacld-3.0: Fix memory leak in hdd_send_re_assoc_event

In case kmalloc fail goto end of function and properly free
other possible allocated memory buffers.

Change-Id: I41d7577471b475b0a2a0daa83c6ffc845314ceb4
CRs-Fixed: 958755
Naveen Rawat 9 tahun lalu
induk
melakukan
8f9e6e392c
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      core/hdd/src/wlan_hdd_assoc.c

+ 2 - 2
core/hdd/src/wlan_hdd_assoc.c

@@ -1379,12 +1379,12 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
 
 	if (!rspRsnIe) {
 		hddLog(LOGE, FL("Unable to allocate RSN IE"));
-		return;
+		goto done;
 	}
 
 	if (!assoc_req_ies) {
 		hdd_err("Unable to allocate Assoc Req IE");
-		return;
+		goto done;
 	}
 	if (pCsrRoamInfo == NULL) {
 		hddLog(LOGE, FL("Invalid CSR roam info"));