[libgweather/issue-80] Plug memory leak




commit 63f961061a5991cf2d39d8d6a3dd53e1305d9555
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun Oct 24 18:18:47 2021 +0100

    Plug memory leak
    
    The GWeather.Info.get_location_name() returns a string with full
    ownership. Instead of going through the public API, we can get the
    location name directly from the data structure.
    
    Fixes: #80

 libgweather/gweather-weather.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index ea7b317c..1d635eb4 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -1344,7 +1344,7 @@ gweather_info_get_weather_summary (GWeatherInfo *info)
         buf = gweather_info_get_sky (info);
     }
 
-    out = g_strdup_printf ("%s: %s", gweather_info_get_location_name (info), buf);
+    out = g_strdup_printf ("%s: %s", info->location.name, buf);
 
     g_free (buf);
     return out;


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