[PATCH obexd] client: fix possible glib assertion failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

In case of error there might be no io channel to shutdown.
---
 client/bluetooth.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/client/bluetooth.c b/client/bluetooth.c
index 3441d4b..558c408 100644
--- a/client/bluetooth.c
+++ b/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");
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux