less leaks

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3833 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-11-09 01:18:20 +00:00
parent c1dbb62b5d
commit af364bca96
10 changed files with 139 additions and 116 deletions

View File

@@ -149,25 +149,26 @@ krb5_kt_get_entry(krb5_context context,
krb5_keytype keytype,
krb5_keytab_entry *entry)
{
krb5_error_code r;
krb5_kt_cursor cursor;
krb5_error_code r;
krb5_kt_cursor cursor;
r = krb5_kt_start_seq_get (context, id, &cursor);
if (r)
return KRB5_KT_NOTFOUND; /* XXX i.e. file not found */
while (krb5_kt_next_entry(context, id, entry, &cursor) == 0) {
if ((principal == NULL
|| (krb5_principal_compare(context,
principal,
entry->principal)))
&& (kvno == 0 || kvno == entry->vno)
&& (keytype == 0 || keytype == entry->keyblock.keytype)) {
krb5_kt_end_seq_get (context, id, &cursor);
return 0;
r = krb5_kt_start_seq_get (context, id, &cursor);
if (r)
return KRB5_KT_NOTFOUND; /* XXX i.e. file not found */
while (krb5_kt_next_entry(context, id, entry, &cursor) == 0) {
if ((principal == NULL
|| (krb5_principal_compare(context,
principal,
entry->principal)))
&& (kvno == 0 || kvno == entry->vno)
&& (keytype == 0 || keytype == entry->keyblock.keytype)) {
krb5_kt_end_seq_get (context, id, &cursor);
return 0;
}
krb5_kt_free_entry(context, entry);
}
}
krb5_kt_end_seq_get (context, id, &cursor);
return KRB5_KT_NOTFOUND;
krb5_kt_end_seq_get (context, id, &cursor);
return KRB5_KT_NOTFOUND;
}
krb5_error_code