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

Commit 4967207c authored by liuchao's avatar liuchao Committed by Pavlin Radoslavov
Browse files

Remove useless NULL-pointer check code in l2cap_client_new

Remove the useless "error:" label and NULL-pointer check block

Test: mm -j 8

Change-Id: I218f5f1e2741a49a0fe9bec749dea2484a1df2eb
parent c3ebb7c2
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -104,18 +104,10 @@ l2cap_client_t *l2cap_client_new(const l2cap_client_callbacks_t *callbacks, void

  ret->remote_mtu = L2CAP_MTU_DEFAULT;
  ret->outbound_fragments = list_new(NULL);
  if (!ret) {
    LOG_ERROR(LOG_TAG, "%s unable to allocate outbound L2CAP fragment list.", __func__);
    goto error;
  }

  list_append(l2cap_clients, ret);

  return ret;

error:;
  osi_free(ret);
  return NULL;
}

void l2cap_client_free(l2cap_client_t *client) {