diff options
author | Adrien Plazas <kekun.plazas@laposte.net> | 2019-06-10 13:51:02 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-06-11 11:12:16 +0000 |
commit | eca3678059f0900191d809d24b4e295c904b79cf (patch) | |
tree | c164bd384aefc131f8b5d2a7859e3c5aa726cfe2 | |
parent | b2eeb479e06fd77c0be54750cc61f2d1566569ff (diff) | |
download | libgweather-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.c | 2 |
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; } /** |