If krb5_cc_start_seq_get() fails inside the loop, close the current
credential cache before continuing to the next one. Reported by Todd
Lipcon.
(cherry picked from commit
1735f2e74767e56ac3bd75de61d41b8363ec6ce4)
ticket: 8509
version_fixed: 1.15
ret = krb5_cc_start_seq_get(context, cache, &cache_cursor);
save_first_error(context, ret, &errsave);
- if (ret)
+ if (ret) {
+ krb5_cc_close(context, cache);
continue;
+ }
while (!found) {
ret = krb5_cc_next_cred(context, cache, &cache_cursor, &creds);
save_first_error(context, ret, &errsave);