From 966e98d50b292b7d60dfe502e509659ba79b3dc1 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 20 Jan 2022 10:06:11 -0500 Subject: [PATCH] lib/krb5: fcc_remove_cred return krb5_cc_end_seq_get failure krb5_cc_end_seq_get() is not expected to fail because it is a cleanup routine. If it fails it indicates something wrong with the cache or the system. Return the failure if there is one. Otherwise, the failure from krb5_cc_next_cred() should be returned UNLESS it is KRB5_CC_END in which case return success. Change-Id: I80e07103e2fb38aa40418a436fa5351fb89549d3 --- lib/krb5/fcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/krb5/fcache.c b/lib/krb5/fcache.c index 37a1409fa..de9fa6337 100644 --- a/lib/krb5/fcache.c +++ b/lib/krb5/fcache.c @@ -1176,7 +1176,7 @@ fcc_remove_cred(krb5_context context, krb5_free_cred_contents(context, &found_cred); } ret2 = krb5_cc_end_seq_get(context, id, &cursor); - if (ret == 0) + if (ret2) /* not expected to fail */ return ret2; if (ret == KRB5_CC_END) return 0;