From a61caff747546441474b1a1fc50c664a13a1378f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 7 Feb 2020 15:11:53 +0100 Subject: iface-modem-location: plug memleaks when updating gps raw variant The helper method returning a variant from a MMLocationGpsRaw would return already a full variant reference instead of a floating one, so we were really increasing the refcount when doing g_variant_ref_sink() in the location interface. Fix this by consolidating all helper methods in libmm-glib that return variants from the different MMLocationXX objects, so that they all return full variants instead of floating ones. --- libmm-glib/mm-location-3gpp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmm-glib/mm-location-3gpp.c') diff --git a/libmm-glib/mm-location-3gpp.c b/libmm-glib/mm-location-3gpp.c index bea3913e..c23aeec5 100644 --- a/libmm-glib/mm-location-3gpp.c +++ b/libmm-glib/mm-location-3gpp.c @@ -291,7 +291,7 @@ mm_location_3gpp_get_string_variant (MMLocation3gpp *self) self->priv->cell_id, self->priv->tracking_area_code); - variant = g_variant_new_string (str); + variant = g_variant_ref_sink (g_variant_new_string (str)); g_free (str); } -- cgit v1.2.3-70-g09d2