From: Claudio Takahasi Date: Wed, 20 Feb 2013 21:55:48 +0000 (-0300) Subject: handsfree-audio: Free agent when exiting X-Git-Tag: 1.13~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a76e4d71f5b3f7906bc3bd573f4db3dc7e152873;p=platform%2Fupstream%2Fofono.git handsfree-audio: Free agent when exiting Free agent allocated resources when oFono exits. --- diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index 499e0de..28053b4 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -47,6 +47,14 @@ struct agent { static struct agent *agent = NULL; +static void agent_free(struct agent *agent) +{ + g_free(agent->owner); + g_free(agent->path); + g_free(agent->codecs); + g_free(agent); +} + static DBusMessage *am_get_cards(DBusConnection *conn, DBusMessage *msg, void *user_data) { @@ -127,4 +135,7 @@ void __ofono_handsfree_audio_manager_cleanup(void) { g_dbus_unregister_interface(ofono_dbus_get_connection(), "/", HFP_AUDIO_MANAGER_INTERFACE); + + if (agent) + agent_free(agent); }