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.
ticket: 8509
target_version: 1.15-next
target_version: 1.14-next
tags: pullup
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);