Skip to content

Commit

Permalink
Merge branch 'bugfix/handle_missing_free' into 'master'
Browse files Browse the repository at this point in the history
fix(nimble): Handle missing free in application

See merge request espressif/esp-idf!29886
  • Loading branch information
rahult-github committed Mar 29, 2024
2 parents 73b45b8 + eafad32 commit 2666391
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/bluetooth/nimble/ble_spp/spp_server/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void ble_server_uart_task(void *pvParameters)
//Waiting for UART event.
if (xQueueReceive(spp_common_uart_queue, (void * )&event, (TickType_t)portMAX_DELAY)) {
switch (event.type) {
//Event of UART receving data
//Event of UART receiving data
case UART_DATA:
if (event.size) {
uint8_t *ntf;
Expand All @@ -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) {
Expand All @@ -377,6 +377,8 @@ void ble_server_uart_task(void *pvParameters)
}
}
}

free(ntf);
}
break;
default:
Expand Down

0 comments on commit 2666391

Please sign in to comment.