From 685ed406d0b6550b83259e996e0e485374c8a00c Mon Sep 17 00:00:00 2001 From: Mikel Astiz Date: Thu, 26 Jan 2012 16:33:44 +0100 Subject: [PATCH] obexd: Fix possible GLib assertion failure In case of error there might be no io channel to shutdown. --- obexd/client/bluetooth.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c index 3441d4bcd..558c4082d 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"); -- 2.47.3