summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/nwmodem/radio-settings.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nwmodem/radio-settings.c b/drivers/nwmodem/radio-settings.c
index 28836308..64ceaf34 100644
--- a/drivers/nwmodem/radio-settings.c
+++ b/drivers/nwmodem/radio-settings.c
@@ -170,7 +170,7 @@ static int nw_radio_settings_probe(struct ofono_radio_settings *rs,
if (!rsd)
return -ENOMEM;
- rsd->chat = chat;
+ rsd->chat = g_at_chat_clone(chat);
ofono_radio_settings_set_data(rs, rsd);
@@ -185,6 +185,8 @@ static void nw_radio_settings_remove(struct ofono_radio_settings *rs)
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
ofono_radio_settings_set_data(rs, NULL);
+
+ g_at_chat_unref(rsd->chat);
g_free(rsd);
}