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
This commit is contained in:
parent
19617d5d04
commit
dba40e1301
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue