Skip to content

Commit 0caf9ba

Browse files
committed
nimble/host: Check if HCI command buffer was allocated
BLE_HS_DBG_ASSERT is not enabled by default, and that code is already handling error path.
1 parent 3160b8c commit 0caf9ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nimble/host/src/ble_hs_hci_cmd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ ble_hs_hci_cmd_send(uint16_t opcode, uint8_t len, const void *cmddata)
5151

5252
cmd = ble_transport_alloc_cmd();
5353
BLE_HS_DBG_ASSERT(cmd != NULL);
54+
if (cmd == NULL) {
55+
return BLE_HS_ENOMEM;
56+
}
5457

5558
cmd->opcode = htole16(opcode);
5659
cmd->length = len;

0 commit comments

Comments
 (0)