[gnome-keyring/wip/dueno/ssh-agent-2: 2/7] login: Don't assume error if there is no matching token



commit 6adf562ad4b44a1f7b3464f683949f93c6310d47
Author: Daiki Ueno <dueno src gnome org>
Date:   Fri Feb 16 16:15:52 2018 +0100

    login: Don't assume error if there is no matching token
    
    gck_modules_token_for_uri() could return NULL without setting error if
    there is no matching token.

 daemon/login/gkd-login.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/daemon/login/gkd-login.c b/daemon/login/gkd-login.c
index 4ff6595..777577e 100644
--- a/daemon/login/gkd-login.c
+++ b/daemon/login/gkd-login.c
@@ -92,7 +92,10 @@ lookup_login_session (GList *modules)
 
        slot = gck_modules_token_for_uri (modules, "pkcs11:token=Secret%20Store", &error);
        if (!slot) {
-               g_warning ("couldn't find secret store module: %s", egg_error_message (error));
+               if (error) {
+                       g_warning ("couldn't find secret store module: %s", egg_error_message (error));
+                       g_error_free (error);
+               }
                return NULL;
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]