From d6b20f4df69ecaff11df5107b899b3297223cabe Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 25 Sep 2013 11:31:08 +0300 Subject: [PATCH] obexd/server: Fix leaking drivers list The leak can be detected by using G_SLICE=always-malloc which will produce the following trace using valgrind: 112 bytes in 7 blocks are definitely lost in loss record 123 of 167 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 0x3B03C6344D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x3B03C647A5: g_slist_append (in /usr/lib64/libglib-2.0.so.0.3600.3) by 0x424DD3: obex_service_driver_list (service.c:76) by 0x42517F: obex_server_init (server.c:64) by 0x40D439: main (main.c:304) --- obexd/src/server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/obexd/src/server.c b/obexd/src/server.c index 36e6c7c1e..007c27e56 100644 --- a/obexd/src/server.c +++ b/obexd/src/server.c @@ -110,6 +110,7 @@ void obex_server_exit(void) struct obex_server *server = l->data; server->transport->stop(server->transport_data); + g_slist_free(server->drivers); g_free(server); }