Diff between 1f949a098250c5c7998a3471241251bd0916c56c and 8d2cc1ff3dd11c9964fd626aae7a0d00037c1f27

Changed Files

File Additions Deletions Status
android/gatt.c +5 -0 modified

Full Patch

diff --git a/android/gatt.c b/android/gatt.c
index 81bfdc0..665cf0f 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -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));