Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43fd4934 authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Add memory allocation checks

Bug: 163134718
Tag: #refactor
Test: gd/cert/run

Change-Id: I63482dad7a6c8a9a7322902d2242c7b57546fdbb
parent 866c5dac
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2883,6 +2883,7 @@ static void bta_dm_set_eir(char* local_name) {

  /* Allocate a buffer to hold HCI command */
  BT_HDR* p_buf = (BT_HDR*)osi_malloc(BTM_CMD_BUF_SIZE);
  ASSERT(p_buf != nullptr);
  p = (uint8_t*)p_buf + BTM_HCI_EIR_OFFSET;

  memset(p, 0x00, HCI_EXT_INQ_RESPONSE_LEN);
+1 −0
Original line number Diff line number Diff line
@@ -630,6 +630,7 @@ bt_property_t* property_deep_copy_array(int num_properties,

    copy = (bt_property_t*)osi_calloc((sizeof(bt_property_t) * num_properties) +
                                      content_len);
    ASSERT(copy != nullptr);
    uint8_t* content = (uint8_t*)(copy + num_properties);

    for (int i = 0; i < num_properties; i++) {