properly close the open keytabs (from Larry Greenfield)

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11490 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-10-21 13:36:59 +00:00
parent fed79b33b9
commit b411502ebe

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2002 Kungliga Tekniska H<>gskolan
* Copyright (c) 2001-2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -42,13 +42,15 @@ struct any_data {
};
static void
free_list (struct any_data *a)
free_list (krb5_context context, struct any_data *a)
{
struct any_data *next;
for (; a != NULL; a = next) {
next = a->next;
free (a->name);
if(a->kt)
krb5_kt_close(context, a->kt);
free (a);
}
}
@@ -91,7 +93,7 @@ any_resolve(krb5_context context, const char *name, krb5_keytab id)
id->data = a0;
return 0;
fail:
free_list (a0);
free_list (context, a0);
return ret;
}
@@ -112,7 +114,7 @@ any_close (krb5_context context,
{
struct any_data *a = id->data;
free_list (a);
free_list (context, a);
return 0;
}