Skip to content

Fix double frees

Georges Basile Stavracas Neto requested to merge gbsneto/fix-refs into master

The 'nearest_station' argument of _gweather_location_new_detached() is transfer-full, which means a ref must be increased when passing this parameter.

However, in various locations, g_autoptr was referencing the passed 'nearest_station', which would cause double-frees down the line.

Fix these double-frees by stealing the 'nearest_location' ref when passing it to _gweather_location_new_detached() when under g_autoptr.

Edited by Georges Basile Stavracas Neto

Merge request reports