diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-10-14 17:00:20 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-10-15 16:15:18 -0500 |
commit | 389da0bb158f09076dbf5afce3811f4d45d7ec46 (patch) | |
tree | 1df2d2712c1a9ef7eb531a5a93cdeed35f0a8f05 /plugins | |
parent | 43e5152934442a185a5e990669f6b9f7175cbc5a (diff) | |
download | ofono-389da0bb158f09076dbf5afce3811f4d45d7ec46.tar.bz2 |
Fix: Do not leak chat memory
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/phonesim.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/phonesim.c b/plugins/phonesim.c index e6d1d9bb..f1c44e5a 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); |