Diff between 38910f4ff6d4ea7c0ca84f22635a35c1f3b5c187 and 8787294ece46922f5f62b8a9fd73028276074026

Changed Files

File Additions Deletions Status
src/attrib-server.c +8 -2 modified

Full Patch

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 15622e4..e0b642c 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -1131,10 +1131,16 @@ guint attrib_channel_attach(GAttrib *attrib)
 	ba2str(&channel->dst, addr);
 
 	device = adapter_find_device(server->adapter, addr);
-	if (device == NULL || device_is_bonded(device) == FALSE) {
+	if (device == NULL) {
+		error("Device object not found for attrib server");
+		g_free(channel);
+		return 0;
+	}
+
+	if (device_is_bonded(device) == FALSE) {
 		char *filename;
 
-		filename = btd_device_get_storage_path(channel->device, "ccc");
+		filename = btd_device_get_storage_path(device, "ccc");
 		unlink(filename);
 		g_free(filename);
 	}