diff options
author | Ray Strode <rstrode@redhat.com> | 2015-07-27 16:31:58 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2015-07-31 15:30:21 -0400 |
commit | 2842336c1607059a9632055e446a5116664a6492 (patch) | |
tree | ba1bf161efadc27bd37755aab4971a167869dafd | |
parent | 857e22c5c99c0a5f656272838b89feb60e66e0c3 (diff) | |
download | gnome-initial-setup-2842336c1607059a9632055e446a5116664a6492.tar.gz |
driver: duplicate password/user object
The driver needs to hold an internal copy of the password,
so the password isn't freed at an inopportune moment.
For symmetry, this commit also takes a reference on the
user object that is passed at the same time.
https://bugzilla.gnome.org/show_bug.cgi?id=752980
-rw-r--r-- | gnome-initial-setup/gis-driver.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gnome-initial-setup/gis-driver.c b/gnome-initial-setup/gis-driver.c index 449745b..7eb9c9a 100644 --- a/gnome-initial-setup/gis-driver.c +++ b/gnome-initial-setup/gis-driver.c @@ -69,7 +69,7 @@ struct _GisDriverPrivate { GisAssistant *assistant; ActUser *user_account; - const gchar *user_password; + gchar *user_password; gchar *lang_id; gchar *username; @@ -89,6 +89,9 @@ gis_driver_finalize (GObject *object) g_free (priv->lang_id); g_free (priv->username); + g_free (priv->user_password); + + g_clear_object (&priv->user_account); G_OBJECT_CLASS (gis_driver_parent_class)->finalize (object); } @@ -180,8 +183,8 @@ gis_driver_set_user_permissions (GisDriver *driver, const gchar *password) { GisDriverPrivate *priv = gis_driver_get_instance_private (driver); - priv->user_account = user; - priv->user_password = password; + g_set_object (&priv->user_account, user); + priv->user_password = g_strdup (password); } void |