Diff between 4b8dc77bb5e4415e36447217ba2ce741b8eab9ed and e35a11d7d3c6924c22bdd0621d34cbb23b5ba9a3

Changed Files

File Additions Deletions Status
src/profile.c +4 -2 modified

Full Patch

diff --git a/src/profile.c b/src/profile.c
index 7c2fe18..f065235 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -1047,7 +1047,7 @@ static struct ext_io *create_conn(struct ext_io *server, GIOChannel *io,
 						bdaddr_t *src, bdaddr_t *dst)
 {
 	struct btd_device *device;
-	struct btd_service *service = NULL;
+	struct btd_service *service;
 	struct ext_io *conn;
 	GIOCondition cond;
 	char addr[18];
@@ -1060,8 +1060,10 @@ static struct ext_io *create_conn(struct ext_io *server, GIOChannel *io,
 	}
 
 	/* Do not add UUID if client role is not enabled */
-	if (!server->ext->enable_client)
+	if (!server->ext->enable_client) {
+		service = NULL;
 		goto done;
+	}
 
 	btd_device_add_uuid(device, server->ext->remote_uuid);
 	service = btd_device_get_service(device, server->ext->remote_uuid);