summaryrefslogtreecommitdiff
path: root/obexd
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-09-25 18:03:21 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-09-26 15:53:37 +0300
commit4b354f1c3d3c740234966e9c31af4db5547c2cc0 (patch)
treed36f91e5490ff425d7ff293ceb638bd50626d396 /obexd
parent0976ae7b4d343b8fff47f96d0ef69ca76ecef0da (diff)
downloadbluez-4b354f1c3d3c740234966e9c31af4db5547c2cc0.tar.gz
obexd/bluetooth: Fix memory leak when adapter is off
sdp_connect fails when Bluetooth adapter is off which leads to the following leak: 37 bytes in 1 blocks are definitely lost in loss record 68 of 165 at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x3B03C64BAE: g_strdup (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x427D5D: bluetooth_connect (bluetooth.c:410) by 0x426CC9: obc_session_create (session.c:454) by 0x425693: create_session (manager.c:203) by 0x43D8A3: process_message.isra.5 (object.c:259) by 0x3B0701CE85: ??? (in /usr/lib64/libdbus-1.so.3.7.4) by 0x3B0700FA30: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4) by 0x43A627: message_dispatch (mainloop.c:76) by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
Diffstat (limited to 'obexd')
-rw-r--r--obexd/client/bluetooth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c
index 1f407d1b4..75deea017 100644
--- a/obexd/client/bluetooth.c
+++ b/obexd/client/bluetooth.c
@@ -407,7 +407,6 @@ static guint bluetooth_connect(const char *source, const char *destination,
session->port = port;
session->user_data = user_data;
- session->service = g_strdup(service);
str2ba(destination, &session->dst);
str2ba(source, &session->src);
@@ -416,6 +415,7 @@ static guint bluetooth_connect(const char *source, const char *destination,
return 0;
}
+ session->service = g_strdup(service);
sessions = g_slist_prepend(sessions, session);
return session->id;