diff options
author | Christian Dywan <christian@twotoasts.de> | 2010-10-08 16:01:07 +0200 |
---|---|---|
committer | Christian Dywan <christian@twotoasts.de> | 2010-10-08 16:03:49 +0200 |
commit | e9a7a2104be326ca96b49b5a583e1ff89f69f9d6 (patch) | |
tree | 32e22b19fcb880a1a788ef397fd0f74fb601db73 /modules | |
parent | 3267cd08e9319ebe202bc83536e0e68d0fb6febc (diff) | |
download | gtk+-e9a7a2104be326ca96b49b5a583e1ff89f69f9d6.tar.gz |
Use and print note for key only if there are credentials
Otherwise key might be printed uninitialized.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/printbackends/cups/gtkprintbackendcups.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c index 62deac4bcb..7b0b0e2a72 100644 --- a/modules/printbackends/cups/gtkprintbackendcups.c +++ b/modules/printbackends/cups/gtkprintbackendcups.c @@ -707,7 +707,6 @@ gtk_print_backend_cups_set_password (GtkPrintBackend *backend, GtkPrintBackendCups *cups_backend = GTK_PRINT_BACKEND_CUPS (backend); GList *l; char dispatch_hostname[HTTP_MAX_URI]; - gchar *key; gchar *username = NULL; gchar *hostname = NULL; gchar *password = NULL; @@ -729,15 +728,15 @@ gtk_print_backend_cups_set_password (GtkPrintBackend *backend, if (hostname != NULL && username != NULL && password != NULL) { - key = g_strconcat (username, "@", hostname, NULL); + gchar *key = g_strconcat (username, "@", hostname, NULL); g_hash_table_insert (cups_backend->auth, key, g_strdup (password)); + GTK_NOTE (PRINTING, + g_print ("CUPS backend: storing password for %s\n", key)); } g_free (cups_backend->username); cups_backend->username = g_strdup (username); - GTK_NOTE (PRINTING, - g_print ("CUPS backend: storing password for %s\n", key)); for (l = cups_backend->requests; l; l = l->next) { |