If data == NULL, not store the config.
authorLove Hörnquist Åstrand <lha@kth.se>
Sun, 22 Mar 2009 17:22:00 +0000 (17:22 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Sun, 22 Mar 2009 17:22:00 +0000 (17:22 +0000)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24911 ec53bebd-3082-4978-b11e-865c3cabbd6b

lib/krb5/cache.c

index 0f62964123ae39bf468eea636e1fdecb7d2f5239..74200aebb313f0ca97b2aa08ff93f1c83312e69f 100644 (file)
@@ -1315,15 +1315,17 @@ krb5_cc_set_config(krb5_context context, krb5_ccache id,
     if (ret && ret != KRB5_CC_NOTFOUND)
         goto out;
 
-    /* not that anyone care when this expire */
-    cred.times.authtime = time(NULL);
-    cred.times.endtime = cred.times.authtime + 3600 * 24 * 30;
-
-    ret = krb5_data_copy(&cred.ticket, data->data, data->length);
-    if (ret)
-       goto out;
-
-    ret = krb5_cc_store_cred(context, id, &cred);
+    if (data) {
+       /* not that anyone care when this expire */
+       cred.times.authtime = time(NULL);
+       cred.times.endtime = cred.times.authtime + 3600 * 24 * 30;
+       
+       ret = krb5_data_copy(&cred.ticket, data->data, data->length);
+       if (ret)
+           goto out;
+       
+       ret = krb5_cc_store_cred(context, id, &cred);
+    }
 
 out:
     krb5_free_cred_contents (context, &cred);