Procházet zdrojové kódy

qcacld-3.0: Avoid memory leak if don't found session

It won't free the nbuffer when tx mgmt frame and don't found session,
then cause memory leak. So free memory to avoid memory leak.

Change-Id: I4e6c2fcdcbf9fa549887602eeaeee3126edc1ef5
CRs-Fixed: 2400974
Wu Gao před 6 roky
rodič
revize
7c0a23f682

+ 3 - 1
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -4761,7 +4761,9 @@ static void lim_tx_mgmt_frame(struct mac_context *mac_ctx,
 	sme_session_id = mb_msg->session_id;
 	session = pe_find_session_by_sme_session_id(mac_ctx, sme_session_id);
 	if (session == NULL) {
-		pe_err("session not found for given sme session");
+		cds_packet_free((void *)packet);
+		pe_err("session not found for given sme session %d",
+		       sme_session_id);
 		return;
 	}