aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-16 11:10:46 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-01-16 11:10:46 +0800
commit5ccf92420b1b396104eb1bc8361510a44beb255a (patch)
tree11c5db2eaba784aea91d18f6b2960783700db542 /mail
parent10331b3632cb9f11514703222a7d6dc99b6fb853 (diff)
downloadgsoc2013-evolution-5ccf92420b1b396104eb1bc8361510a44beb255a.tar.gz
gsoc2013-evolution-5ccf92420b1b396104eb1bc8361510a44beb255a.tar.zst
gsoc2013-evolution-5ccf92420b1b396104eb1bc8361510a44beb255a.zip
Fix a potential uninitialized variable use in emae_authtype_changed().
Caught by the Clang Static Analyzer.
Diffstat (limited to 'mail')
-rw-r--r--mail/em-account-editor.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 6d25004f23..42a6063870 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