aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-iface-modem-location.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mm-iface-modem-location.c b/src/mm-iface-modem-location.c
index 225c9fa1..69b092e7 100644
--- a/src/mm-iface-modem-location.c
+++ b/src/mm-iface-modem-location.c
@@ -165,6 +165,8 @@ build_location_dictionary (GVariant *previous,
if (location_3gpp_value)
g_variant_unref (location_3gpp_value);
location_3gpp_value = mm_location_3gpp_get_string_variant (location_3gpp);
+ if (location_3gpp_value)
+ g_variant_ref_sink (location_3gpp_value);
}
if (location_3gpp_value) {
@@ -172,6 +174,7 @@ build_location_dictionary (GVariant *previous,
"{uv}",
MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI,
location_3gpp_value);
+ g_variant_unref (location_3gpp_value);
}
/* If a new one given, use it */
@@ -179,39 +182,51 @@ build_location_dictionary (GVariant *previous,
if (location_gps_nmea_value)
g_variant_unref (location_gps_nmea_value);
location_gps_nmea_value = mm_location_gps_nmea_get_string_variant (location_gps_nmea);
+ if (location_gps_nmea_value)
+ g_variant_ref_sink (location_gps_nmea_value);
}
- if (location_gps_nmea_value)
+ if (location_gps_nmea_value) {
g_variant_builder_add (&builder,
"{uv}",
MM_MODEM_LOCATION_SOURCE_GPS_NMEA,
location_gps_nmea_value);
+ g_variant_unref (location_gps_nmea_value);
+ }
/* If a new one given, use it */
if (location_gps_raw) {
if (location_gps_raw_value)
g_variant_unref (location_gps_raw_value);
location_gps_raw_value = mm_location_gps_raw_get_dictionary (location_gps_raw);
+ if (location_gps_raw_value)
+ g_variant_ref_sink (location_gps_raw_value);
}
- if (location_gps_raw_value)
+ if (location_gps_raw_value) {
g_variant_builder_add (&builder,
"{uv}",
MM_MODEM_LOCATION_SOURCE_GPS_RAW,
location_gps_raw_value);
+ g_variant_unref (location_gps_raw_value);
+ }
/* If a new one given, use it */
if (location_cdma_bs) {
if (location_cdma_bs_value)
g_variant_unref (location_cdma_bs_value);
location_cdma_bs_value = mm_location_cdma_bs_get_dictionary (location_cdma_bs);
+ if (location_cdma_bs_value)
+ g_variant_ref_sink (location_cdma_bs_value);
}
- if (location_cdma_bs_value)
+ if (location_cdma_bs_value) {
g_variant_builder_add (&builder,
"{uv}",
MM_MODEM_LOCATION_SOURCE_CDMA_BS,
location_cdma_bs_value);
+ g_variant_unref (location_cdma_bs_value);
+ }
return g_variant_builder_end (&builder);
}