[PATCH BlueZ] GAttrib: Fix leak when remote disconnects

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

 



---
 attrib/gattrib.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index ccddabe..12a9fcf 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -193,10 +193,11 @@ static void attrib_destroy(GAttrib *attrib)
 	if (attrib->write_watch > 0)
 		g_source_remove(attrib->write_watch);
 
-	if (attrib->read_watch > 0) {
+	if (attrib->read_watch > 0)
 		g_source_remove(attrib->read_watch);
+
+	if (attrib->io)
 		g_io_channel_unref(attrib->io);
-	}
 
 	g_free(attrib->buf);
 
-- 
1.7.8.4

--
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