aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mm-modem-anydata-cdma.c6
-rw-r--r--plugins/mm-modem-cinterion-gsm.c13
-rw-r--r--plugins/mm-modem-huawei-gsm.c4
-rw-r--r--plugins/mm-modem-novatel-gsm.c3
-rwxr-xr-xplugins/mm-modem-samsung-gsm.c4
-rw-r--r--plugins/mm-modem-sierra-gsm.c4
-rw-r--r--plugins/mm-modem-x22x-gsm.c3
-rw-r--r--plugins/mm-modem-zte.c6
8 files changed, 27 insertions, 16 deletions
diff --git a/plugins/mm-modem-anydata-cdma.c b/plugins/mm-modem-anydata-cdma.c
index 7b6b37a2..d26d3ec0 100644
--- a/plugins/mm-modem-anydata-cdma.c
+++ b/plugins/mm-modem-anydata-cdma.c
@@ -183,6 +183,9 @@ evdo_state_done (MMAtSerialPort *port,
}
}
+ g_match_info_free (match_info);
+ g_regex_unref (r);
+
done:
mm_generic_cdma_query_reg_state_set_callback_evdo_state (info, reg_state);
mm_callback_info_schedule (info);
@@ -254,6 +257,9 @@ state_done (MMAtSerialPort *port,
}
}
+ g_match_info_free (match_info);
+ g_regex_unref (r);
+
mm_generic_cdma_query_reg_state_set_callback_1x_state (info, reg_state);
/* Try for EVDO state too */
diff --git a/plugins/mm-modem-cinterion-gsm.c b/plugins/mm-modem-cinterion-gsm.c
index 6f3b46f4..97afb9f5 100644
--- a/plugins/mm-modem-cinterion-gsm.c
+++ b/plugins/mm-modem-cinterion-gsm.c
@@ -652,6 +652,9 @@ get_smong_cb (MMAtSerialPort *port,
priv->sind_psinfo = TRUE;
}
+ g_match_info_free (match_info);
+ g_regex_unref (regex);
+
mm_callback_info_set_result (info, GUINT_TO_POINTER (act), NULL);
mm_callback_info_schedule (info);
}
@@ -698,12 +701,14 @@ get_sind_cb (MMAtSerialPort *port,
g_free (ind_value);
mm_callback_info_set_result (info, GUINT_TO_POINTER (act), NULL);
mm_callback_info_schedule (info);
- return;
+ } else {
+ /* If there was no 'psinfo' indicator, we'll try AT^SMONG and read the cell
+ * info table. */
+ mm_at_serial_port_queue_command (port, "^SMONG", 3, get_smong_cb, info);
}
- /* If there was no 'psinfo' indicator, we'll try AT^SMONG and read the cell
- * info table. */
- mm_at_serial_port_queue_command (port, "^SMONG", 3, get_smong_cb, info);
+ g_match_info_free (match_info);
+ g_regex_unref (regex);
}
static void
diff --git a/plugins/mm-modem-huawei-gsm.c b/plugins/mm-modem-huawei-gsm.c
index 5f4c2fbb..f2cdb0bd 100644
--- a/plugins/mm-modem-huawei-gsm.c
+++ b/plugins/mm-modem-huawei-gsm.c
@@ -599,9 +599,9 @@ send_huawei_cpin_done (MMAtSerialPort *port,
mm_callback_info_set_result (info, GUINT_TO_POINTER (attempts_left), NULL);
- g_match_info_free (match_info);
-
done:
+ if (match_info)
+ g_match_info_free (match_info);
if (r)
g_regex_unref (r);
mm_serial_port_close (MM_SERIAL_PORT (port));
diff --git a/plugins/mm-modem-novatel-gsm.c b/plugins/mm-modem-novatel-gsm.c
index 5d78db73..706664c5 100644
--- a/plugins/mm-modem-novatel-gsm.c
+++ b/plugins/mm-modem-novatel-gsm.c
@@ -198,8 +198,6 @@ parse_nwrat_response (GString *response,
mode = atoi (str);
g_free (str);
- g_match_info_free (match_info);
-
if (mode < 0 || mode > 2) {
g_set_error_literal (error, MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL,
"Failed to parse mode/tech response");
@@ -219,6 +217,7 @@ parse_nwrat_response (GString *response,
success = TRUE;
out:
+ g_match_info_free (match_info);
g_regex_unref (r);
return success;
}
diff --git a/plugins/mm-modem-samsung-gsm.c b/plugins/mm-modem-samsung-gsm.c
index df7a4b44..2c1de77e 100755
--- a/plugins/mm-modem-samsung-gsm.c
+++ b/plugins/mm-modem-samsung-gsm.c
@@ -357,9 +357,9 @@ send_samsung_pinnum_done (MMAtSerialPort *port,
mm_callback_info_set_result (info, GUINT_TO_POINTER (attempts_left), NULL);
- g_match_info_free (match_info);
-
done:
+ if (match_info)
+ g_match_info_free (match_info);
if (r)
g_regex_unref (r);
mm_serial_port_close (MM_SERIAL_PORT (port));
diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index b5cf2f55..1d3cafbe 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -73,7 +73,7 @@ get_allowed_mode_done (MMAtSerialPort *port,
{
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
GRegex *r = NULL;
- GMatchInfo *match_info;
+ GMatchInfo *match_info = NULL;
/* If the modem has already been removed, return without
* scheduling callback */
@@ -128,6 +128,8 @@ get_allowed_mode_done (MMAtSerialPort *port,
}
done:
+ if (match_info)
+ g_match_info_free (match_info);
if (r)
g_regex_unref (r);
mm_callback_info_schedule (info);
diff --git a/plugins/mm-modem-x22x-gsm.c b/plugins/mm-modem-x22x-gsm.c
index 012733d2..a31cd36b 100644
--- a/plugins/mm-modem-x22x-gsm.c
+++ b/plugins/mm-modem-x22x-gsm.c
@@ -81,8 +81,6 @@ parse_syssel_response (GString *response,
mode = atoi (str);
g_free (str);
- g_match_info_free (match_info);
-
if (mode < 0 || mode > 2) {
g_set_error_literal (error, MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL,
"Failed to parse mode/tech response");
@@ -102,6 +100,7 @@ parse_syssel_response (GString *response,
success = TRUE;
out:
+ g_match_info_free (match_info);
g_regex_unref (r);
return success;
}
diff --git a/plugins/mm-modem-zte.c b/plugins/mm-modem-zte.c
index 6c9f3954..88ef7344 100644
--- a/plugins/mm-modem-zte.c
+++ b/plugins/mm-modem-zte.c
@@ -105,7 +105,7 @@ get_allowed_mode_done (MMAtSerialPort *port,
{
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
GRegex *r = NULL;
- GMatchInfo *match_info;
+ GMatchInfo *match_info = NULL;
/* If the modem has already been removed, return without
* scheduling callback */
@@ -138,8 +138,6 @@ get_allowed_mode_done (MMAtSerialPort *port,
pref_acq = atoi (str);
g_free (str);
- g_match_info_free (match_info);
-
if (cm_mode < 0 || cm_mode > 2 || pref_acq < 0 || pref_acq > 2) {
info->error = g_error_new (MM_MODEM_ERROR,
MM_MODEM_ERROR_GENERAL,
@@ -164,6 +162,8 @@ get_allowed_mode_done (MMAtSerialPort *port,
}
done:
+ if (match_info)
+ g_match_info_free (match_info);
if (r)
g_regex_unref (r);
mm_callback_info_schedule (info);