Tue Oct 4 16:20:48 1994 Theodore Y. Ts'o (tytso@dcl)
+ * ktf_get_en.c (krb5_ktfile_get_entry): Fix to compare using
+ new_entry instead of cur_entry. (Bug made in modification
+ on Sep 28th). Don't free cur_entry twice on errors.
+
* ktfile.h
* ktf_wreslv.c (krb5_ktfile_wresolve):
* ktf_resolv.c (krb5_ktf_resolv): Resolv's first argument is now a
* is exited with a break statement.
*/
cur_entry.principal = 0;
+ cur_entry.vno = 0;
+ cur_entry.key.contents = 0;
while (TRUE) {
if (kerror = krb5_ktfileint_read_entry(id, &new_entry))
break;
- if (krb5_principal_compare(principal, cur_entry.principal)) {
+ if (krb5_principal_compare(principal, new_entry.principal)) {
if (kvno == IGNORE_VNO) {
if (cur_entry.vno < new_entry.vno) {
krb5_kt_free_entry(&cur_entry);
if (kerror == KRB5_KT_END)
kerror = KRB5_KT_NOTFOUND;
(void) krb5_ktfileint_close(id);
- if (cur_entry.principal)
- krb5_kt_free_entry(&cur_entry);
+ krb5_kt_free_entry(&cur_entry);
return kerror;
}
if ((kerror = krb5_ktfileint_close(id)) != 0) {
krb5_kt_free_entry(&cur_entry);
- if (cur_entry.principal)
- krb5_kt_free_entry(&cur_entry);
return kerror;
}
*entry = cur_entry;