From ee215d601f057c9c26fbf2487230b829cefebabe Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 7 Aug 2012 16:26:38 +0300 Subject: [PATCH] obexd: Fix possible memory leak in bluetooth driver 2,210 (64 direct, 2,146 indirect) bytes in 2 blocks are definitely lost in loss record 150 of 155 at 0x4A0884D: malloc (vg_replace_malloc.c:263) by 0x3B2900F8A1: sdp_create (sdp.c:3656) by 0x3B2900FAE0: sdp_connect (sdp.c:4604) by 0x415902: adapter_reply (bluetooth.c:421) by 0x3B22C0C429: ??? (in /usr/lib64/libdbus-1.so.3.5.6) by 0x3B22C0F5E9: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.5.6) by 0x4059A7: message_dispatch (mainloop.c:76) by 0x32CD64822A: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x32CD647694: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x32CD6479C7: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x32CD647DC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x40567F: main (main.c:175) --- obexd/client/bluetooth.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c index 0d91ea1d2..a22d717b2 100644 --- a/obexd/client/bluetooth.c +++ b/obexd/client/bluetooth.c @@ -160,6 +160,9 @@ static void session_destroy(struct bluetooth_session *session) g_io_channel_unref(session->io); } + if (session->sdp) + sdp_close(session->sdp); + if (session->conn) dbus_connection_unref(session->conn);