From eb8a741be287d83825b9e035a27c51cc43eacd56 Mon Sep 17 00:00:00 2001 From: luomanruo Date: Thu, 24 Aug 2023 15:09:44 +0800 Subject: [PATCH] ble: Assert when getting memory fail --- components/bt/controller/esp32c2/bt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index 5d241bce9d..b52d9480e7 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -312,6 +312,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len) if (*(data) == DATA_TYPE_COMMAND) { struct ble_hci_cmd *cmd = NULL; cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD); + assert(cmd); memcpy((uint8_t *)cmd, data + 1, len - 1); ble_hci_trans_hs_cmd_tx((uint8_t *)cmd); }