for (cursor = KTLINK(id); cursor && cursor->entry; cursor = cursor->next) {\r
entry = cursor->entry;\r
\r
- /* if the principal isn't the one requested, free new_entry\r
- and continue to the next. */\r
+ /* if the principal isn't the one requested, continue to the next. */\r
\r
if (!krb5_principal_compare(context, principal, entry->principal))\r
continue;\r
\r
- /* if the enctype is not ignored and doesn't match, free new_entry\r
+ /* if the enctype is not ignored and doesn't match, \r
and continue to the next */\r
if (enctype != IGNORE_ENCTYPE) {\r
if ((err = krb5_c_enctype_compare(context, enctype, \r
\r
/* if we found an entry that matches, ... */\r
if (match) { \r
- out_entry->magic = entry->magic;\r
- out_entry->timestamp = entry->timestamp;\r
- out_entry->vno = entry->vno;\r
- out_entry->key = entry->key; \r
- err = krb5_copy_keyblock_contents(context, &(entry->key),\r
+ out_entry->magic = match->magic;\r
+ out_entry->timestamp = match->timestamp;\r
+ out_entry->vno = match->vno;\r
+ out_entry->key = match->key; \r
+ err = krb5_copy_keyblock_contents(context, &(match->key),\r
&(out_entry->key));\r
/*\r
* Coerce the enctype of the output keyblock in case we\r
* got an inexact match on the enctype.\r
*/\r
- out_entry->key.enctype = enctype;\r
+ if(enctype != IGNORE_ENCTYPE)\r
+ out_entry->key.enctype = enctype;\r
if(!err) {\r
err = krb5_copy_principal(context, \r
- entry->principal, \r
+ match->principal, \r
&(out_entry->principal));\r
}\r
} else {\r