From 044ead90ce41a78be2bc3efe1bb78195132e7258 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Wed, 27 Mar 2024 19:17:58 +0530 Subject: [PATCH] fix(nimble): Handle missing free in application --- examples/bluetooth/nimble/ble_spp/spp_server/main/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/bluetooth/nimble/ble_spp/spp_server/main/main.c b/examples/bluetooth/nimble/ble_spp/spp_server/main/main.c index 7618bc03d7..86aa7fe9f8 100644 --- a/examples/bluetooth/nimble/ble_spp/spp_server/main/main.c +++ b/examples/bluetooth/nimble/ble_spp/spp_server/main/main.c @@ -367,7 +367,7 @@ void ble_server_uart_task(void *pvParameters) /* Check if client has subscribed to notifications */ if (conn_handle_subs[i]) { struct os_mbuf *txom; - txom = ble_hs_mbuf_from_flat(ntf, sizeof(ntf)); + txom = ble_hs_mbuf_from_flat(ntf, event.size); rc = ble_gatts_notify_custom(i, ble_spp_svc_gatt_read_val_handle, txom); if (rc == 0) { @@ -377,6 +377,8 @@ void ble_server_uart_task(void *pvParameters) } } } + + free(ntf); } break; default: