[PATCH BlueZ 8/9] unit/test-gdbus-client: Fix memory leak

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This fixes leaking DBusConnection created by client_force_disconnect
causing the following trace:

40 bytes in 1 blocks are definitely lost in loss record 501 of 839
   at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x519D9E1: ??? (in /usr/lib64/libdbus-1.so.3.8.11)
   by 0x5191F94: ??? (in /usr/lib64/libdbus-1.so.3.8.11)
   by 0x517AC1A: ??? (in /usr/lib64/libdbus-1.so.3.8.11)
   by 0x517D754: ??? (in /usr/lib64/libdbus-1.so.3.8.11)
   by 0x51790FB: ??? (in /usr/lib64/libdbus-1.so.3.8.11)
   by 0x407739: g_dbus_setup_private (mainloop.c:314)
   by 0x404ECC: client_force_disconnect (test-gdbus-client.c:879)
   by 0x4108B2: run_callback (tester.c:413)
   by 0x4E7E7FA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.2)
   by 0x4E7EB97: ??? (in /usr/lib64/libglib-2.0.so.0.4200.2)
   by 0x4E7EEC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.2)
---
 unit/test-gdbus-client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index 51cf8b4..ecbe51e 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -857,6 +857,7 @@ static void proxy_force_disconnect(GDBusProxy *proxy, void *user_data)
 
 	dbus_connection_flush(conn);
 	dbus_connection_close(conn);
+	dbus_connection_unref(conn);
 	context->data = NULL;
 }
 
-- 
2.1.0

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