[libgweather/wip/chergert/plug-leaks: 2/3] GWeatherLocation: Plug various memory leaks
- From: Bastien Nocera <hadess src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [libgweather/wip/chergert/plug-leaks: 2/3] GWeatherLocation: Plug various memory leaks
 
- Date: Mon,  6 Apr 2020 12:42:49 +0000 (UTC)
 
commit 1081c9c8eead68a14f0de55f5d6edb5793789091
Author: Christian Hergert <chergert redhat com>
Date:   Tue Mar 10 15:27:11 2020 -0700
    GWeatherLocation: Plug various memory 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 b5f4f3d..1477e51 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]