Diff between 4e4c8e2348b46b94acaaac916740bef569844af0 and 685ed406d0b6550b83259e996e0e485374c8a00c

Changed Files

File Additions Deletions Status
obexd/client/bluetooth.c +5 -3 modified

Full Patch

diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c
index 3441d4b..558c408 100644
--- a/obexd/client/bluetooth.c
+++ b/obexd/client/bluetooth.c
@@ -269,9 +269,11 @@ static void search_callback(uint8_t type, uint16_t status,
 	}
 
 failed:
-	g_io_channel_shutdown(session->io, TRUE, NULL);
-	g_io_channel_unref(session->io);
-	session->io = NULL;
+	if (session->io != NULL) {
+		g_io_channel_shutdown(session->io, TRUE, NULL);
+		g_io_channel_unref(session->io);
+		session->io = NULL;
+	}
 
 	g_set_error(&gerr, OBC_BT_ERROR, -EIO,
 					"Unable to find service record");