diff -Nru geoclue-2.0-2.5.3/debian/changelog geoclue-2.0-2.5.6/debian/changelog --- geoclue-2.0-2.5.3/debian/changelog 2019-08-13 11:43:05.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/changelog 2020-02-28 14:04:03.000000000 +0000 @@ -1,13 +1,21 @@ -geoclue-2.0 (2.5.3-1ubuntu1) eoan; urgency=medium +geoclue-2.0 (2.5.6-0ubuntu1) focal; urgency=medium + * New upstream version * Resynchronize with Debian. Remaining change: - debian/control: Make libgeoclue-2-0 depend on geoclue-2.0, since it is a wrapper around the DBus service. This probably breaks Multi-Arch coinstallability and we should take a different fix from Debian once there is one (See #864305). (LP: #1696171) + -- Sebastien Bacher Fri, 28 Feb 2020 15:03:57 +0100 - -- Sebastien Bacher Tue, 13 Aug 2019 13:42:37 +0200 +geoclue-2.0 (2.5.5-1) unstable; urgency=medium + + * [b4cfe4e7] debian/rules: Install the NEWS file as upstream changelog + * [3d876ed8] New upstream version 2.5.5 + * [29ba01cf] Set libexecdir to /usr/libexec now that the policy allows it + + -- Laurent Bigonville Wed, 02 Oct 2019 13:20:41 +0200 geoclue-2.0 (2.5.3-1) unstable; urgency=medium diff -Nru geoclue-2.0-2.5.3/debian/control geoclue-2.0-2.5.6/debian/control --- geoclue-2.0-2.5.3/debian/control 2019-08-13 11:43:58.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/control 2020-02-28 14:04:11.000000000 +0000 @@ -1,7 +1,8 @@ Source: geoclue-2.0 Section: utils Priority: optional -Maintainer: Laurent Bigonville +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Laurent Bigonville Uploaders: Craig Andrews Build-Depends: debhelper (>= 11), gobject-introspection (>= 0.9.6), diff -Nru geoclue-2.0-2.5.3/debian/geoclue-2.0.install geoclue-2.0-2.5.6/debian/geoclue-2.0.install --- geoclue-2.0-2.5.3/debian/geoclue-2.0.install 2019-07-11 11:53:11.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/geoclue-2.0.install 2020-02-28 13:37:05.000000000 +0000 @@ -5,8 +5,8 @@ etc/xdg/autostart/geoclue-demo-agent.desktop lib/systemd/system/ usr/lib/*/pkgconfig/geoclue-2.0.pc -usr/lib/geoclue-2.0/demos/agent -usr/lib/geoclue-2.0/geoclue +usr/libexec/geoclue-2.0/demos/agent +usr/libexec/geoclue usr/share/applications/geoclue-demo-agent.desktop usr/share/dbus-1/interfaces/ usr/share/dbus-1/system-services/ diff -Nru geoclue-2.0-2.5.3/debian/geoclue-2-demo.install geoclue-2.0-2.5.6/debian/geoclue-2-demo.install --- geoclue-2.0-2.5.3/debian/geoclue-2-demo.install 2019-07-11 11:53:11.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/geoclue-2-demo.install 2020-02-28 13:37:05.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/geoclue-2.0/demos/where-am-i +usr/libexec/geoclue-2.0/demos/where-am-i usr/share/applications/geoclue-where-am-i.desktop diff -Nru geoclue-2.0-2.5.3/debian/patches/02-move-demo-lib.patch geoclue-2.0-2.5.6/debian/patches/02-move-demo-lib.patch --- geoclue-2.0-2.5.3/debian/patches/02-move-demo-lib.patch 2019-07-11 11:53:11.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/patches/02-move-demo-lib.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Description: Move the demos from /usr/share to /usr/lib -Author: Laurent Bigonville - ---- a/demo/geoclue-where-am-i.desktop.in.in -+++ b/demo/geoclue-where-am-i.desktop.in.in -@@ -3,7 +3,7 @@ Name=Where am I? - GenericName=Demo geolocation application - Comment=Find your current location - Keywords=geolocation; --Exec=@libexecdir@/geoclue-2.0/demos/where-am-i -+Exec=/usr/lib/geoclue-2.0/demos/where-am-i - Icon=mark-location-symbolic - NoDisplay=true - Terminal=true ---- a/demo/geoclue-demo-agent.desktop.in.in -+++ b/demo/geoclue-demo-agent.desktop.in.in -@@ -2,7 +2,7 @@ - Name=Geoclue Demo agent - GenericName=Demo geoclue agent - Keywords=geolocation; --Exec=@libexecdir@/geoclue-2.0/demos/agent -+Exec=/usr/lib/geoclue-2.0/demos/agent - Icon=mark-location-symbolic - NotShowIn=GNOME; - NoDisplay=true diff -Nru geoclue-2.0-2.5.3/debian/patches/series geoclue-2.0-2.5.6/debian/patches/series --- geoclue-2.0-2.5.3/debian/patches/series 2019-07-11 11:53:11.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -02-move-demo-lib.patch diff -Nru geoclue-2.0-2.5.3/debian/rules geoclue-2.0-2.5.6/debian/rules --- geoclue-2.0-2.5.3/debian/rules 2019-07-11 11:53:11.000000000 +0000 +++ geoclue-2.0-2.5.6/debian/rules 2020-02-28 13:37:05.000000000 +0000 @@ -17,7 +17,7 @@ endif override_dh_auto_configure: - dh_auto_configure -- --libexecdir=/usr/lib/geoclue-2.0 \ + dh_auto_configure -- --libexecdir=/usr/libexec \ -Ddbus-srv-user=geoclue \ -Dsystemd-system-unit-dir=/lib/systemd/system \ ${BUILD_DOC} \ @@ -30,13 +30,11 @@ # does not include. dh_auto_test || true -override_dh_auto_install: - dh_auto_install - mv $(CURDIR)/debian/tmp/usr/lib/geoclue-2.0/geoclue-2.0/demos \ - $(CURDIR)/debian/tmp/usr/lib/geoclue-2.0/demos - %: dh $@ --with autoreconf,gir override_dh_missing: dh_missing --list-missing + +override_dh_installchangelogs: + dh_installchangelogs NEWS diff -Nru geoclue-2.0-2.5.3/docs/meson.build geoclue-2.0-2.5.6/docs/meson.build --- geoclue-2.0-2.5.3/docs/meson.build 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/docs/meson.build 2020-02-26 13:19:24.000000000 +0000 @@ -1,7 +1,3 @@ -if get_option('libgeoclue') - subdir('lib') -endif - if get_option('enable-backend') conf = configuration_data() conf.set_quoted('VERSION', gclue_version) @@ -26,3 +22,7 @@ dependencies: libgeoclue_dep, install: true) endif + +if get_option('libgeoclue') + subdir('lib') +endif diff -Nru geoclue-2.0-2.5.3/interface/org.freedesktop.GeoClue2.Client.xml geoclue-2.0-2.5.6/interface/org.freedesktop.GeoClue2.Client.xml --- geoclue-2.0-2.5.3/interface/org.freedesktop.GeoClue2.Client.xml 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/interface/org.freedesktop.GeoClue2.Client.xml 2020-02-26 13:19:24.000000000 +0000 @@ -39,7 +39,7 @@ Contains the current distance threshold in meters. This value is used by the service when it gets new location info. If the distance moved is below the threshold, it won't emit the LocationUpdated signal. - The default value is 0. When TimeThreshold is zero, it always emits + The default value is 0. When DistanceThreshold is zero, it always emits the signal. --> diff -Nru geoclue-2.0-2.5.3/meson.build geoclue-2.0-2.5.6/meson.build --- geoclue-2.0-2.5.3/meson.build 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/meson.build 2020-02-26 13:19:24.000000000 +0000 @@ -1,4 +1,4 @@ -project('geoclue', 'c', version: '2.5.3', meson_version : '>= 0.47.2') +project('geoclue', 'c', version: '2.5.6', meson_version : '>= 0.47.2') gclue_version = meson.project_version() ver_arr = gclue_version.split('.') diff -Nru geoclue-2.0-2.5.3/NEWS geoclue-2.0-2.5.6/NEWS --- geoclue-2.0-2.5.3/NEWS 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/NEWS 2020-02-26 13:19:24.000000000 +0000 @@ -1,3 +1,31 @@ +2.5.6 +===== + +- Fix crashes in WiFi handling code. +- Plug a leak. + +Contributors: + +Amaury Pouly +Jan Alexander Steffens (heftig) +Will Thompson +Zeeshan Ali + +2.5.5 +===== + +- Plug another leak. +- Fix another buffer overflow. +- Fix WiFi-geolocation that got broken in 2.5.4. +- Put freequently used small strings on the stack to avoid excessive memory + usage. + +2.5.4 +===== + +- Plug a leak that becomes pretty huge after a while of running Geoclue. +- Fix a buffer-overflow. + 2.5.3 ===== diff -Nru geoclue-2.0-2.5.3/src/gclue-config.c geoclue-2.0-2.5.6/src/gclue-config.c --- geoclue-2.0-2.5.3/src/gclue-config.c 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/src/gclue-config.c 2020-02-26 13:19:24.000000000 +0000 @@ -232,7 +232,8 @@ "url", &error); if (error != NULL) { - g_warning ("%s", error->message); + g_debug ("Failed to get config \"wifi/url\": %s", + error->message); g_clear_error (&error); priv->wifi_url = g_strdup (DEFAULT_WIFI_URL); } @@ -242,7 +243,7 @@ "submit-data", &error); if (error != NULL) { - g_debug ("Failed to get config wifi/submit-data: %s", + g_debug ("Failed to get config \"wifi/submit-data\": %s", error->message); g_error_free (error); @@ -254,8 +255,9 @@ "submission-url", &error); if (error != NULL) { - g_debug ("No wifi submission URL: %s", error->message); - g_error_free (error); + g_debug ("Failed to get config \"wifi/submission-url\": %s", + error->message); + g_clear_error (&error); priv->wifi_submit_url = g_strdup (DEFAULT_WIFI_SUBMIT_URL); } @@ -264,7 +266,8 @@ "submission-nick", &error); if (error != NULL) { - g_debug ("No wifi submission nick: %s", error->message); + g_debug ("Failed to get config \"wifi/submission-nick\": %s", + error->message); g_error_free (error); } } diff -Nru geoclue-2.0-2.5.3/src/gclue-location-source.c geoclue-2.0-2.5.6/src/gclue-location-source.c --- geoclue-2.0-2.5.3/src/gclue-location-source.c 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/src/gclue-location-source.c 2020-02-26 13:19:24.000000000 +0000 @@ -290,7 +290,7 @@ if (source->priv->active_counter > 1) { g_debug ("%s already active, not starting.", G_OBJECT_TYPE_NAME (source)); - return FALSE; + return TRUE; } if (source->priv->compute_movement) { @@ -313,7 +313,7 @@ if (source->priv->active_counter == 0) { g_debug ("%s already inactive, not stopping.", G_OBJECT_TYPE_NAME (source)); - return FALSE; + return TRUE; } source->priv->active_counter--; diff -Nru geoclue-2.0-2.5.3/src/gclue-min-uint.c geoclue-2.0-2.5.6/src/gclue-min-uint.c --- geoclue-2.0-2.5.3/src/gclue-min-uint.c 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/src/gclue-min-uint.c 2020-02-26 13:19:24.000000000 +0000 @@ -181,6 +181,8 @@ } } + g_list_free (values); + return value; } diff -Nru geoclue-2.0-2.5.3/src/gclue-mozilla.c geoclue-2.0-2.5.6/src/gclue-mozilla.c --- geoclue-2.0-2.5.3/src/gclue-mozilla.c 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/src/gclue-mozilla.c 2020-02-26 13:19:24.000000000 +0000 @@ -40,62 +40,66 @@ * its easy to switch to Google's API. **/ -static char * -variant_to_string (GVariant *variant, guint *len) +#define BSSID_LEN 7 +#define BSSID_STR_LEN 18 +#define MAX_SSID_LEN 32 + +static guint +variant_to_string (GVariant *variant, guint max_len, char *ret) { - guint n_bytes, i; - char *ret; + guint i; + guint len; - n_bytes = g_variant_n_children (variant); - if (len != NULL) - *len = n_bytes; - if (n_bytes <= 0) - return NULL; - ret = g_malloc (n_bytes + 1); - ret[n_bytes] = '\0'; + len = g_variant_n_children (variant); + if (len == 0) + return 0; + g_return_val_if_fail(len < max_len, 0); + ret[len] = '\0'; - for (i = 0; i < n_bytes; i++) + for (i = 0; i < len; i++) g_variant_get_child (variant, i, "y", &ret[i]); - return ret; + return len; } -static char * -get_ssid_from_bss (WPABSS *bss) +static guint +get_ssid_from_bss (WPABSS *bss, char *ssid) { GVariant *variant = wpa_bss_get_ssid (bss); if (variant == NULL) - return NULL; + return 0; - return variant_to_string (variant, NULL); + return variant_to_string (variant, MAX_SSID_LEN, ssid); } -static char * -get_bssid_from_bss (WPABSS *bss) +static gboolean +get_bssid_from_bss (WPABSS *bss, char *bssid) { GVariant *variant; - char *raw_bssid; - char *bssid; - guint raw_len, len, i, j; + char raw_bssid[BSSID_LEN] = { 0 }; + guint raw_len, i; variant = wpa_bss_get_bssid (bss); if (variant == NULL) - return NULL; + return FALSE; - raw_bssid = variant_to_string (variant, &raw_len); - len = raw_len * 2 + raw_len; - bssid = g_malloc (len); - for (i = 0, j = 0; i < len; i = i + 3, j++) - g_snprintf (bssid + i, - 4, - "%02x:", - (unsigned char) raw_bssid[j]); - bssid[len - 1] = '\0'; + raw_len = variant_to_string (variant, BSSID_LEN, raw_bssid); + g_return_val_if_fail (raw_len == BSSID_LEN - 1, FALSE); - return bssid; + for (i = 0; i < BSSID_LEN - 1; i++) { + unsigned char c = (unsigned char) raw_bssid[i]; + + if (i == BSSID_LEN - 2) { + g_snprintf (bssid + (i * 3), 3, "%02x", c); + } else { + g_snprintf (bssid + (i * 3), 4, "%02x:", c); + } + } + + return TRUE; } static const char * @@ -159,7 +163,7 @@ for (iter = bss_list; iter != NULL; iter = iter->next) { WPABSS *bss = WPA_BSS (iter->data); - char *mac; + char mac[BSSID_STR_LEN] = { 0 }; gint16 strength_dbm; if (gclue_mozilla_should_ignore_bss (bss)) @@ -167,9 +171,8 @@ json_builder_begin_object (builder); json_builder_set_member_name (builder, "macAddress"); - mac = get_bssid_from_bss (bss); + get_bssid_from_bss (bss, mac); json_builder_add_string_value (builder, mac); - g_free (mac); json_builder_set_member_name (builder, "signalStrength"); strength_dbm = wpa_bss_get_signal (bss); @@ -333,7 +336,7 @@ for (iter = bss_list; iter != NULL; iter = iter->next) { WPABSS *bss = WPA_BSS (iter->data); - char *mac; + char mac[BSSID_STR_LEN] = { 0 }; gint16 strength_dbm; guint16 frequency; @@ -342,9 +345,8 @@ json_builder_begin_object (builder); json_builder_set_member_name (builder, "key"); - mac = get_bssid_from_bss (bss); + get_bssid_from_bss (bss, mac); json_builder_add_string_value (builder, mac); - g_free (mac); json_builder_set_member_name (builder, "signal"); strength_dbm = wpa_bss_get_signal (bss); @@ -413,16 +415,17 @@ gboolean gclue_mozilla_should_ignore_bss (WPABSS *bss) { - g_autofree char *ssid = NULL, *bssid = NULL; + char ssid[MAX_SSID_LEN] = { 0 }; + char bssid[BSSID_STR_LEN] = { 0 }; + guint len; - bssid = get_bssid_from_bss (bss); - if (bssid == NULL) { + if (!get_bssid_from_bss (bss, bssid)) { g_debug ("Ignoring WiFi AP with unknown BSSID.."); return TRUE; } - ssid = get_ssid_from_bss (bss); - if (ssid == NULL || g_str_has_suffix (ssid, "_nomap")) { + len = get_ssid_from_bss (bss, ssid); + if (len == 0 || g_str_has_suffix (ssid, "_nomap")) { g_debug ("SSID for WiFi AP '%s' missing or has '_nomap' suffix." ", Ignoring..", bssid); diff -Nru geoclue-2.0-2.5.3/src/gclue-service-manager.c geoclue-2.0-2.5.6/src/gclue-service-manager.c --- geoclue-2.0-2.5.3/src/gclue-service-manager.c 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/src/gclue-service-manager.c 2020-02-26 13:19:24.000000000 +0000 @@ -258,6 +258,7 @@ GError *error = NULL; guint32 user_id; gint64 now; + gboolean system_app; info = gclue_client_info_new_finish (res, &error); if (info == NULL) { @@ -277,7 +278,10 @@ agent_proxy = g_hash_table_lookup (priv->agents, GINT_TO_POINTER (user_id)); now = g_get_monotonic_time (); + + system_app = (gclue_client_info_get_xdg_id (info) == NULL); if (agent_proxy == NULL && + !system_app && now < (priv->init_time + AGENT_WAIT_TIMEOUT_USEC)) { /* Its possible that geoclue was just launched on GetClient * call, in which case agents need some time to register diff -Nru geoclue-2.0-2.5.3/src/gclue-wifi.c geoclue-2.0-2.5.6/src/gclue-wifi.c --- geoclue-2.0-2.5.3/src/gclue-wifi.c 2019-05-16 14:21:43.000000000 +0000 +++ geoclue-2.0-2.5.6/src/gclue-wifi.c 2020-02-26 13:19:24.000000000 +0000 @@ -34,6 +34,10 @@ */ #define WIFI_SCAN_TIMEOUT_LOW_ACCURACY 300 +#define BSSID_LEN 7 +#define BSSID_STR_LEN 18 +#define MAX_SSID_LEN 32 + /** * SECTION:gclue-wifi * @short_description: WiFi-based geolocation @@ -192,58 +196,60 @@ GVariant *properties, gpointer user_data); -static char * -variant_to_string (GVariant *variant, guint *len) +static guint +variant_to_string (GVariant *variant, guint max_len, char *ret) { - guint n_bytes, i; - char *ret; + guint i; + guint len; - n_bytes = g_variant_n_children (variant); - if (len != NULL) - *len = n_bytes; - if (n_bytes <= 0) - return NULL; - ret = g_malloc (n_bytes + 1); - ret[n_bytes] = '\0'; + len = g_variant_n_children (variant); + if (len == 0) + return 0; + g_return_val_if_fail(len < max_len, 0); + ret[len] = '\0'; - for (i = 0; i < n_bytes; i++) + for (i = 0; i < len; i++) g_variant_get_child (variant, i, "y", &ret[i]); - return ret; + return len; } -static char * -get_ssid_from_bss (WPABSS *bss) +static guint +get_ssid_from_bss (WPABSS *bss, char *ssid) { GVariant *variant = wpa_bss_get_ssid (bss); - return variant_to_string (variant, NULL); + return variant_to_string (variant, MAX_SSID_LEN, ssid); } -static char * -get_bssid_from_bss (WPABSS *bss) +static gboolean +get_bssid_from_bss (WPABSS *bss, char *bssid) { GVariant *variant; - char *raw_bssid; - char *bssid; - guint raw_len, len, i, j; + char raw_bssid[BSSID_LEN] = { 0 }; + guint raw_len, i; variant = wpa_bss_get_bssid (bss); + if (variant == NULL) + return FALSE; - raw_bssid = variant_to_string (variant, &raw_len); - len = raw_len * 2 + raw_len; - bssid = g_malloc (len); - for (i = 0, j = 0; i < len; i = i + 3, j++) - g_snprintf (bssid + i, - 4, - "%02x:", - (unsigned char) raw_bssid[j]); - bssid[len - 1] = '\0'; + raw_len = variant_to_string (variant, BSSID_LEN, raw_bssid); + g_return_val_if_fail (raw_len == BSSID_LEN - 1, FALSE); - return bssid; + for (i = 0; i < BSSID_LEN - 1; i++) { + unsigned char c = (unsigned char) raw_bssid[i]; + + if (i == BSSID_LEN - 2) { + g_snprintf (bssid + (i * 3), 3, "%02x", c); + } else { + g_snprintf (bssid + (i * 3), 4, "%02x:", c); + } + } + + return TRUE; } static void @@ -256,12 +262,11 @@ if (g_hash_table_replace (wifi->priv->bss_proxies, g_strdup (path), bss)) { - char *ssid; + char ssid[MAX_SSID_LEN] = { 0 }; wifi->priv->bss_list_changed = TRUE; - ssid = get_ssid_from_bss (bss); + get_ssid_from_bss (bss, ssid); g_debug ("WiFi AP '%s' added.", ssid); - g_free (ssid); } } @@ -275,12 +280,13 @@ const char *path; if (wpa_bss_get_signal (bss) <= -90) { - char *bssid = get_bssid_from_bss (bss); + char bssid[BSSID_STR_LEN] = { 0 }; + + get_bssid_from_bss (bss, bssid); g_debug ("WiFi AP '%s' still has very low strength (%u dBm)" ", ignoring again..", bssid, wpa_bss_get_signal (bss)); - g_free (bssid); return; } @@ -300,7 +306,7 @@ GClueWifi *wifi = GCLUE_WIFI (user_data); WPABSS *bss; GError *error = NULL; - char *ssid; + char ssid[MAX_SSID_LEN] = { 0 }; bss = wpa_bss_proxy_new_for_bus_finish (res, &error); if (bss == NULL) { @@ -316,18 +322,18 @@ return; } - ssid = get_ssid_from_bss (bss); + get_ssid_from_bss (bss, ssid); g_debug ("WiFi AP '%s' added.", ssid); - g_free (ssid); if (wpa_bss_get_signal (bss) <= -90) { const char *path; - char *bssid = get_bssid_from_bss (bss); + char bssid[BSSID_STR_LEN] = { 0 }; + + get_bssid_from_bss (bss, bssid); g_debug ("WiFi AP '%s' has very low strength (%u dBm)" ", ignoring for now..", bssid, wpa_bss_get_signal (bss)); - g_free (bssid); g_signal_connect (G_OBJECT (bss), "notify::signal", G_CALLBACK (on_bss_signal_notify), @@ -360,16 +366,15 @@ static gboolean remove_bss_from_hashtable (const gchar *path, GHashTable *hash_table) { - char *ssid; + char ssid[MAX_SSID_LEN] = { 0 }; WPABSS *bss = NULL; bss = g_hash_table_lookup (hash_table, path); if (bss == NULL) return FALSE; - ssid = get_ssid_from_bss (bss); + get_ssid_from_bss (bss, ssid); g_debug ("WiFi AP '%s' removed.", ssid); - g_free (ssid); g_hash_table_remove (hash_table, path); @@ -545,14 +550,18 @@ { GClueWifiPrivate *priv = wifi->priv; - if (priv->bss_added_id == 0 || priv->interface == NULL) - return; - cancel_wifi_scan (wifi); - g_signal_handler_disconnect (priv->interface, priv->bss_added_id); - priv->bss_added_id = 0; - g_signal_handler_disconnect (priv->interface, priv->bss_removed_id); - priv->bss_removed_id = 0; + + if (priv->bss_added_id != 0) { + g_signal_handler_disconnect (priv->interface, + priv->bss_added_id); + priv->bss_added_id = 0; + } + if (priv->bss_removed_id != 0) { + g_signal_handler_disconnect (priv->interface, + priv->bss_removed_id); + priv->bss_removed_id = 0; + } g_hash_table_remove_all (priv->bss_proxies); g_hash_table_remove_all (priv->ignored_bss_proxies); @@ -829,10 +838,13 @@ GError **error) { GList *bss_list; /* As in Access Points */ + SoupMessage *msg; bss_list = get_bss_list (GCLUE_WIFI (source), NULL); - return gclue_mozilla_create_query (bss_list, NULL, error); + msg = gclue_mozilla_create_query (bss_list, NULL, error); + g_list_free (bss_list); + return msg; } static GClueLocation * @@ -849,13 +861,16 @@ GError **error) { GList *bss_list; /* As in Access Points */ + SoupMessage * msg; bss_list = get_bss_list (GCLUE_WIFI (source), error); if (bss_list == NULL) return NULL; - return gclue_mozilla_create_submit_query (location, - bss_list, - NULL, - error); + msg = gclue_mozilla_create_submit_query (location, + bss_list, + NULL, + error); + g_list_free (bss_list); + return msg; }