From adf5a77d5f4f5f0e94f0fad669ee7192d1a5f5f5 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Mon, 5 Apr 2010 22:03:02 -0400
Subject: [PATCH] Fix a possible crash when changing password
---
src/run-passwd.c | 1 -
src/um-password-dialog.c | 6 ++----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/run-passwd.c b/src/run-passwd.c
index c702364..7e40661 100644
--- a/src/run-passwd.c
+++ b/src/run-passwd.c
@@ -57,7 +57,6 @@ typedef enum {
struct PasswdHandler {
const char *current_password;
const char *new_password;
- const char *retyped_password;
/* Communication with the passwd program */
GPid backend_pid;
diff --git a/src/um-password-dialog.c b/src/um-password-dialog.c
index d581a18..81c03dd 100644
--- a/src/um-password-dialog.c
+++ b/src/um-password-dialog.c
@@ -777,10 +777,6 @@ um_password_dialog_set_user (UmPasswordDialog *um,
GdkPixbuf *pixbuf;
GtkTreeModel *model;
- if (um->passwd_handler) {
- passwd_destroy (um->passwd_handler);
- um->passwd_handler = NULL;
- }
if (um->user) {
g_object_unref (um->user);
um->user = NULL;
@@ -803,6 +799,8 @@ um_password_dialog_set_user (UmPasswordDialog *um,
if (um_user_get_uid (um->user) == getuid()) {
gtk_widget_show (um->old_password_label);
gtk_widget_show (um->old_password_entry);
+ if (um->passwd_handler != NULL)
+ passwd_destroy (um->passwd_handler);
um->passwd_handler = passwd_init ();
um->old_password_ok = FALSE;
}
--
1.7.0.1