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

Commit 36259c2a authored by liuchao's avatar liuchao Committed by android-build-merger
Browse files

Fix a NULL-pointer access before check in connect_int

am: 167275f8

Change-Id: I3217f206ef56d73dbac01b19eeb123b6cfb68870
parents d1e4fdfb 167275f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -291,12 +291,12 @@ static bt_status_t init(bthf_client_callbacks_t* callbacks) {
 ******************************************************************************/
static bt_status_t connect_int(bt_bdaddr_t* bd_addr, uint16_t uuid) {
  btif_hf_client_cb_t* cb = btif_hf_client_allocate_cb();
  bdcpy(cb->peer_bda.address, bd_addr->address);
  if (cb == NULL) {
    BTIF_TRACE_ERROR("%s: could not allocate block!", __func__);
    return BT_STATUS_BUSY;
  }

  bdcpy(cb->peer_bda.address, bd_addr->address);
  if (is_connected(cb)) return BT_STATUS_BUSY;

  cb->state = BTHF_CLIENT_CONNECTION_STATE_CONNECTING;