[PATCH 5/8] attrib: Fix possible use after free

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

 



Move io channels unrefs after last use of channels.
---
 src/attrib-server.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 8e20903..1a9bd69 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -127,13 +127,13 @@ static void gatt_server_free(struct gatt_server *server)
 	g_list_free_full(server->database, attrib_free);
 
 	if (server->l2cap_io != NULL) {
-		g_io_channel_unref(server->l2cap_io);
 		g_io_channel_shutdown(server->l2cap_io, FALSE, NULL);
+		g_io_channel_unref(server->l2cap_io);
 	}
 
 	if (server->le_io != NULL) {
-		g_io_channel_unref(server->le_io);
 		g_io_channel_shutdown(server->le_io, FALSE, NULL);
+		g_io_channel_unref(server->le_io);
 	}
 
 	g_slist_free_full(server->clients, (GDestroyNotify) channel_free);
-- 
1.7.9.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