mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-08 04:23:35 +08:00
android/gatt: Fix possible NULL pointer defererence
If memory allocation failed, return error from handle_client_register.
This commit is contained in:
parent
1f949a0982
commit
8d2cc1ff3d
@ -234,6 +234,11 @@ static void handle_client_register(const void *buf, uint16_t len)
|
||||
}
|
||||
|
||||
client = new0(struct gatt_client, 1);
|
||||
if (!client) {
|
||||
error("gatt: cannot allocate memory for registering client");
|
||||
status = HAL_STATUS_FAILED;
|
||||
goto failed;
|
||||
}
|
||||
|
||||
memcpy(client->uuid, cmd->uuid, sizeof(client->uuid));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user