[libgweather/wip/chergert/plug-leaks: 1/2] location: plug various leaks



commit febaecfe05786289d586198bc7e7a3c66509797b
Author: Christian Hergert <chergert redhat com>
Date:   Tue Mar 10 15:27:11 2020 -0700

    location: plug various leaks

 libgweather/gweather-location.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
index b386641..0a4b956 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -1538,7 +1538,8 @@ gweather_location_common_deserialize (GWeatherLocation *world,
                                                      longitude / M_PI * 180.0);
         if (found && (g_strcmp0 (name, found->english_name) == 0 ||
                       g_strcmp0 (name, found->local_name) == 0))
-           return gweather_location_ref (found);
+           return g_steal_pointer (&found);
+       g_clear_pointer (&found, gweather_location_unref);
     }
 
     if (station_code[0] == '\0')
@@ -1674,6 +1675,9 @@ gweather_location_format_two_deserialize (GWeatherLocation *world,
        parent_longitude = 0;
     }
 
+    g_variant_unref (latlon_variant);
+    g_variant_unref (parent_latlon_variant);
+
     return gweather_location_common_deserialize(world, name, station_code, is_city,
                                                latlon_valid, latitude, longitude,
                                                parent_latlon_valid, parent_latitude, parent_longitude);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]