Free agents allocated resources when hfp_audio plugin exits.
---
plugins/hfp_audio.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/plugins/hfp_audio.c b/plugins/hfp_audio.c
index 32ddebc..ffc3138 100644
--- a/plugins/hfp_audio.c
+++ b/plugins/hfp_audio.c
@@ -51,6 +51,16 @@ enum hfp_codec {
static GSList *agents = NULL;
+static void agent_free(gpointer data)
+{
+ struct agent *agent = data;
+
+ g_free(agent->owner);
+ g_free(agent->path);
+ g_free(agent->codecs);
+ g_free(agent);
+}
+
static int agent_cmp(gconstpointer a, gconstpointer b)
{
const struct agent *agent = a;
@@ -158,6 +168,8 @@ static void hfp_audio_exit(void)
{
g_dbus_unregister_interface(ofono_dbus_get_connection(), "/",
HFP_AUDIO_MANAGER_INTERFACE);
+
+ g_slist_free_full(agents, agent_free);
}
OFONO_PLUGIN_DEFINE(hfp_audio, "Handsfree Audio Plugin", VERSION,
--
1.7.11.7
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono