daemon: Issues fixed in handling over the token_data to auth session
authorAmarnath Valluri <amarnath.valluri@linux.intel.com>
Mon, 22 Jul 2013 13:10:23 +0000 (16:10 +0300)
committerAmarnath Valluri <amarnath.valluri@linux.intel.com>
Mon, 22 Jul 2013 17:29:46 +0000 (20:29 +0300)
src/daemon/gsignond-auth-session.c
src/daemon/gsignond-identity.c

index 6eb5c28..a47e80e 100644 (file)
@@ -566,7 +566,8 @@ gsignond_auth_session_new (GSignondIdentityInfo *info, const gchar *method, GSig
                       "method", method, NULL);
     auth_session->priv->proxy = proxy;
     auth_session->priv->identity_info = g_hash_table_ref ((GHashTable *)info);
-    auth_session->priv->token_data = token_data;
+    auth_session->priv->token_data = token_data ? gsignond_dictionary_ref(token_data)
+                                                : gsignond_dictionary_new();
 
     return auth_session;
 }
index ddd3d8c..d6ccfca 100644 (file)
@@ -529,9 +529,8 @@ gsignond_identity_get_auth_session (GSignondIdentity *identity,
     if ( (identity_id = gsignond_identity_info_get_id (identity->priv->info)) !=
             GSIGNOND_IDENTITY_INFO_NEW_IDENTITY) {
         token_data = gsignond_daemon_load_identity_data (identity->priv->owner, identity_id, method);
-    } else {
-        token_data = gsignond_dictionary_new();
-    }        
+    } 
+    if (!token_data) token_data = gsignond_dictionary_new();
 
     session = gsignond_auth_session_new (identity->priv->info, method, token_data);