aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-passwords.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-passwords.c')
-rw-r--r--e-util/e-passwords.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c
index 7d5f25a545..996d6cc592 100644
--- a/e-util/e-passwords.c
+++ b/e-util/e-passwords.c
@@ -246,32 +246,29 @@ e_passwords_forget_password (const char *key)
char *
e_passwords_get_password (const char *key)
{
- char *path, *passwd = g_hash_table_lookup (passwords, key);
+ char *passwd = g_hash_table_lookup (passwords, key);
+ char *path;
CORBA_Environment ev;
- char *encoded;
-
+
if (passwd)
return g_strdup (passwd);
-
+
/* not part of the session hash, look it up in the on disk db */
path = password_path (key);
-
+
/* We need to pass an ev to bonobo-conf, or it will emit a
* g_warning if the data isn't found.
*/
CORBA_exception_init (&ev);
- encoded = bonobo_config_get_string (db, path, &ev);
+ passwd = bonobo_config_get_string (db, path, &ev);
CORBA_exception_free (&ev);
-
+
g_free (path);
-
- if (!encoded)
+
+ if (passwd)
+ return decode_base64 (passwd);
+ else
return NULL;
-
- passwd = decode_base64 (encoded);
- g_free (encoded);
-
- return passwd;
}
/**