[evolution] Fix a potential uninitialized variable use in emae_authtype_changed().
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution] Fix a potential uninitialized variable use in emae_authtype_changed().
- Date: Sat, 16 Jan 2010 03:21:16 +0000 (UTC)
commit 5ccf92420b1b396104eb1bc8361510a44beb255a
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Jan 15 22:10:46 2010 -0500
Fix a potential uninitialized variable use in emae_authtype_changed().
Caught by the Clang Static Analyzer.
mail/em-account-editor.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 6d25004..42a6063 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -1748,8 +1748,8 @@ emae_authtype_changed (GtkComboBox *dropdown, EMAccountEditorService *service)
gint id = gtk_combo_box_get_active (dropdown);
GtkTreeModel *model;
GtkTreeIter iter;
- CamelServiceAuthType *authtype;
CamelURL *url;
+ gboolean sensitive = FALSE;
if (id == -1)
return;
@@ -1759,19 +1759,24 @@ emae_authtype_changed (GtkComboBox *dropdown, EMAccountEditorService *service)
url = emae_account_url (service->emae, emae_service_info[service->type].account_uri_key);
model = gtk_combo_box_get_model (dropdown);
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, id)) {
+ CamelServiceAuthType *authtype;
+
gtk_tree_model_get (model, &iter, 1, &authtype, -1);
if (authtype)
camel_url_set_authmech (url, authtype->authproto);
else
camel_url_set_authmech (url, NULL);
emae_uri_changed (service, url);
+
+ sensitive =
+ authtype != NULL &&
+ authtype->need_password &&
+ e_account_writable (account,
+ emae_service_info[service->type].save_passwd_key);
}
camel_url_free (url);
- gtk_widget_set_sensitive ((GtkWidget *)service->remember,
- authtype
- ?(authtype->need_password && e_account_writable (account, emae_service_info[service->type].save_passwd_key))
- :FALSE);
+ gtk_widget_set_sensitive ((GtkWidget *)service->remember, sensitive);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]