You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/09/29 17:23:03 UTC

[mynewt-nimble] 03/03: nimble/ll: Fix aux_data leak

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit ef7c30dcbe0af4d3cc8802281341088bb7dd2c0a
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Sep 29 10:16:51 2022 +0200

    nimble/ll: Fix aux_data leak
    
    We should mark hci stream if ext adv report event is either disabled or
    cannot be allocated, otherwise we will never free aux_data.
---
 nimble/controller/src/ble_ll_scan_aux.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nimble/controller/src/ble_ll_scan_aux.c b/nimble/controller/src/ble_ll_scan_aux.c
index 60b4b5c1..63e2feb2 100644
--- a/nimble/controller/src/ble_ll_scan_aux.c
+++ b/nimble/controller/src/ble_ll_scan_aux.c
@@ -587,6 +587,7 @@ ble_ll_hci_ev_send_ext_adv_report_for_aux(struct os_mbuf *rxpdu,
     int rc;
 
     if (!ble_ll_hci_is_le_event_enabled(BLE_HCI_LE_SUBEV_EXT_ADV_RPT)) {
+        aux->hci_state = BLE_LL_SCAN_AUX_H_DONE;
         return -1;
     }
 
@@ -601,6 +602,7 @@ ble_ll_hci_ev_send_ext_adv_report_for_aux(struct os_mbuf *rxpdu,
     } else {
         hci_ev = ble_ll_hci_ev_alloc_ext_adv_report_for_aux(addrd, aux);
         if (!hci_ev) {
+            aux->hci_state = BLE_LL_SCAN_AUX_H_DONE;
             return -1;
         }
     }