From 4fbab16b41308813e6f59546e5aeb52d367963b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 22 Mar 2009 17:22:00 +0000 Subject: [PATCH] If data == NULL, not store the config. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24911 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/cache.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index 0f6296412..74200aebb 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -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);