From: Denis Kenzior Date: Wed, 14 Oct 2009 22:00:20 +0000 (-0500) Subject: Fix: Do not leak chat memory X-Git-Tag: 0.8~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=389da0bb158f09076dbf5afce3811f4d45d7ec46;p=platform%2Fupstream%2Fofono.git Fix: Do not leak chat memory --- diff --git a/plugins/phonesim.c b/plugins/phonesim.c index e6d1d9b..f1c44e5 100644 --- a/plugins/phonesim.c +++ b/plugins/phonesim.c @@ -136,7 +136,6 @@ static void mux_setup(GAtMux *mux, gpointer user_data) return; } - data->chat = NULL; data->mux = mux; if (getenv("OFONO_AT_DEBUG")) @@ -238,9 +237,11 @@ static int phonesim_enable(struct ofono_modem *modem) } - if (data->use_mux) + if (data->use_mux) { g_at_mux_setup_gsm0710(data->chat, mux_setup, modem, NULL); - else + g_at_chat_unref(data->chat); + data->chat = NULL; + } else g_at_chat_send(data->chat, "AT+CFUN=1", NULL, cfun_set_on_cb, modem, NULL);