aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-modem-anydata-cdma.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-05-16 12:16:04 +0200
committerAleksander Morgado <aleksander@lanedo.com>2011-06-05 17:51:00 +0200
commit9323daec015ecad65c39b6020b62e864c027d858 (patch)
tree3a26a62be12c53effbdefabdc70ae27eea728e0e /plugins/mm-modem-anydata-cdma.c
parentf7dff81eecd6694c2596200fc2c3226de0396b7d (diff)
core, plugins: if modem removed don't process response
We try to avoid a memory leak when info->error is reset, as well as a second re-schedule of the info.
Diffstat (limited to 'plugins/mm-modem-anydata-cdma.c')
-rw-r--r--plugins/mm-modem-anydata-cdma.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mm-modem-anydata-cdma.c b/plugins/mm-modem-anydata-cdma.c
index 0e7e65c5..7b6b37a2 100644
--- a/plugins/mm-modem-anydata-cdma.c
+++ b/plugins/mm-modem-anydata-cdma.c
@@ -128,6 +128,11 @@ evdo_state_done (MMAtSerialPort *port,
GRegex *r;
GMatchInfo *match_info;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error) {
/* Leave superclass' reg state alone if AT*HSTATE isn't supported */
mm_callback_info_schedule (info);
@@ -195,6 +200,11 @@ state_done (MMAtSerialPort *port,
GRegex *r;
GMatchInfo *match_info;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error) {
/* Leave superclass' reg state alone if AT*STATE isn't supported */
mm_callback_info_schedule (info);