aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib/mm-common-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmm-glib/mm-common-helpers.c')
-rw-r--r--libmm-glib/mm-common-helpers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c
index 7bd845b9..f99e58d8 100644
--- a/libmm-glib/mm-common-helpers.c
+++ b/libmm-glib/mm-common-helpers.c
@@ -219,6 +219,12 @@ mm_common_sms_storages_garray_to_variant (GArray *array)
return mm_common_sms_storages_array_to_variant (NULL, 0);
}
+static void
+clear_modem_port_info (MMModemPortInfo *info)
+{
+ g_free (info->name);
+}
+
GArray *
mm_common_ports_variant_to_garray (GVariant *variant)
{
@@ -232,6 +238,7 @@ mm_common_ports_variant_to_garray (GVariant *variant)
if (n > 0) {
array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemPortInfo), n);
+ g_array_set_clear_func (array, (GDestroyNotify) clear_modem_port_info);
for (i = 0; i < n; i++) {
MMModemPortInfo info;