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

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

commit 07bd537b7eab381c19617182bdabdfcd0cd5a2e8
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 7 18:36:37 2026 +0200

    nimble/host: Fix SDU leak on EATT bearer disconnection
    
    When an EATT bearer was disconnected due to unsupported opcode or lack
    of encryption the received SDU was not freed. As SDUs are allocated
    from a small dedicated pool this eventually prevented creation of new
    EATT bearers.
    
    Assisted-by: Claude:claude-opus-5-5
---
 nimble/host/src/ble_eatt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nimble/host/src/ble_eatt.c b/nimble/host/src/ble_eatt.c
index 0c8aefced..904e52e93 100644
--- a/nimble/host/src/ble_eatt.c
+++ b/nimble/host/src/ble_eatt.c
@@ -279,6 +279,7 @@ ble_eatt_l2cap_event_fn(struct ble_l2cap_event *event, void 
*arg)
              *  • The Signed Write Without Response sub-procedure shall only be
              *  supported on the LE Fixed Channel Unenhanced ATT bearer.
              */
+            os_mbuf_free_chain(event->receive.sdu_rx);
             ble_l2cap_disconnect(eatt->chan);
             return BLE_HS_EREJECT;
         }
@@ -294,6 +295,7 @@ ble_eatt_l2cap_event_fn(struct ble_l2cap_event *event, void 
*arg)
          * encryption.
          */
         if (rc != 0 || !desc.sec_state.encrypted) {
+            os_mbuf_free_chain(event->receive.sdu_rx);
             ble_l2cap_disconnect(eatt->chan);
             return BLE_HS_EREJECT;
         }

Reply via email to