[gnome-control-center] network: Allocate storage for zone name during D-Bus call
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Allocate storage for zone name during D-Bus call
- Date: Tue, 10 Feb 2015 11:42:14 +0000 (UTC)
commit dba40e13019c9adef1137a13e3a065c7a048ea46
Author: Tim Waugh <twaugh redhat com>
Date: Tue Nov 11 14:59:56 2014 +0000
network: Allocate storage for zone name during D-Bus call
The call to nm_setting_connection_get_zone() returns a pointer to
memory that will be freed before the D-Bus reply handler is called.
Make sure to take a copy of the string, and free it when finished.
https://bugzilla.gnome.org/show_bug.cgi?id=739971
.../network/connection-editor/firewall-helpers.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/panels/network/connection-editor/firewall-helpers.c
b/panels/network/connection-editor/firewall-helpers.c
index cd41a2b..593ce9a 100644
--- a/panels/network/connection-editor/firewall-helpers.c
+++ b/panels/network/connection-editor/firewall-helpers.c
@@ -72,6 +72,7 @@ get_zones_reply (GObject *source,
}
gtk_combo_box_set_active (GTK_COMBO_BOX (d->combo), idx);
+ g_free (d->zone);
g_free (d);
}
@@ -86,7 +87,7 @@ firewall_ui_setup (NMSettingConnection *setting,
bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
d = g_new0 (GetZonesReplyData, 1);
- d->zone = nm_setting_connection_get_zone (setting);
+ d->zone = g_strdup (nm_setting_connection_get_zone (setting));
d->combo = combo;
g_dbus_connection_call (bus,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]