diff options
Diffstat (limited to 'plugins/ublox/mm-modem-helpers-ublox.c')
-rw-r--r-- | plugins/ublox/mm-modem-helpers-ublox.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/ublox/mm-modem-helpers-ublox.c b/plugins/ublox/mm-modem-helpers-ublox.c index e69053d5..442ff601 100644 --- a/plugins/ublox/mm-modem-helpers-ublox.c +++ b/plugins/ublox/mm-modem-helpers-ublox.c @@ -1290,8 +1290,6 @@ mm_ublox_build_ubandsel_set_command (GArray *bands, if (bands->len == 1 && g_array_index (bands, MMModemBand, 0) == MM_MODEM_BAND_ANY) return g_strdup ("+UBANDSEL=0"); - ubandsel_nums = g_array_sized_new (FALSE, FALSE, sizeof (guint), G_N_ELEMENTS (band_configuration)); - for (i = 0; i < G_N_ELEMENTS (band_configuration); i++) { if (g_str_has_prefix (model, band_configuration[i].model)) break; @@ -1300,10 +1298,11 @@ mm_ublox_build_ubandsel_set_command (GArray *bands, if (i == G_N_ELEMENTS (band_configuration)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Unknown modem model %s", model); - g_array_unref (ubandsel_nums); return NULL; } + ubandsel_nums = g_array_sized_new (FALSE, FALSE, sizeof (guint), bands->len); + for (j = 0; j < bands->len; j++) { MMModemBand band; gboolean found = FALSE; |