Closed Safari77 closed 6 years ago
OMG. How did that work before...? It was there since GNOME 2.
Thanks for spotting it, https://github.com/mate-desktop/mate-panel/commit/7099408402dc41f39e32f4afa3e874e968e879bc should fix it.
I would say that it is not use-after-free, but copy-paste error! I think it should be wind
there...
Hmm, wind
is const gchar *
...
it should be:
if (strcmp (wind, dgettext ("mate-applets-2.0", "Unknown")) != 0)
Ah, I see now. Not sure if wind
can be "Unknown" too, but it makes more sense in this condition than apparent
.
Ok, added https://github.com/mate-desktop/mate-panel/commit/3b9119b3bb941de61654d45eb693a85f48d56289 for that. Thanks.
What if weather_info* returned error codes (when something is unknown) so you don't have to do strcmp and dgettext and other obfuscated C coding contest things 🤔
Well, we have old API here, libgweather has something like that in gweather_info_get_value_wind
function and others. Gotta update API or maybe try moving to libgweather.
We should really moved to libgweather soon.
Yeah, it's on my list for 1.22. It will be second try. The first one failed due to lots of differences in API.
Expected behaviour
no use-after-free 🤓🤞
Actual behaviour
Fix is easy enough, move that g_free after
apparent
's last usage.MATE general version
1.20.1
Package version
1.20.1