diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index 34786d8b2..a71ae5e55 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -1211,7 +1211,7 @@ krb5_cc_set_config(krb5_context context, krb5_ccache id, /* Remove old configuration */ ret = krb5_cc_remove_cred(context, id, 0, &cred); - if (ret != KRB5_CC_NOTFOUND) + if (ret && ret != KRB5_CC_NOTFOUND) goto out; /* not that anyone care when this expire */