summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Plazas <kekun.plazas@laposte.net>2019-06-10 13:51:02 +0200
committerBastien Nocera <hadess@hadess.net>2019-06-11 11:12:16 +0000
commiteca3678059f0900191d809d24b4e295c904b79cf (patch)
treec164bd384aefc131f8b5d2a7859e3c5aa726cfe2
parentb2eeb479e06fd77c0be54750cc61f2d1566569ff (diff)
downloadlibgweather-eca3678059f0900191d809d24b4e295c904b79cf.tar.gz
GWeatherLocation: Don't return a copy of the name
The documentation of gweather_location_get_name(), its const return type, coding conventions and its usage in the library itself all indicate it shouldn't return a newly allocated string, and is hence leaking memory. Fixes https://gitlab.gnome.org/GNOME/libgweather/issues/22
-rw-r--r--libgweather/gweather-location.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c
index 24a5b60..612a03e 100644
--- a/libgweather/gweather-location.c
+++ b/libgweather/gweather-location.c
@@ -578,7 +578,7 @@ gweather_location_get_name (GWeatherLocation *loc)
{
g_return_val_if_fail (loc != NULL, NULL);
- return g_strdup (loc->local_name);
+ return loc->local_name;
}
/**