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)
This commit is contained in:
Luiz Augusto von Dentz 2013-09-25 11:31:08 +03:00
parent b68ae057e3
commit d6b20f4df6

View File

@ -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);
}