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:
@@ -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).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -42,13 +42,15 @@ struct any_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_list (struct any_data *a)
|
free_list (krb5_context context, struct any_data *a)
|
||||||
{
|
{
|
||||||
struct any_data *next;
|
struct any_data *next;
|
||||||
|
|
||||||
for (; a != NULL; a = next) {
|
for (; a != NULL; a = next) {
|
||||||
next = a->next;
|
next = a->next;
|
||||||
free (a->name);
|
free (a->name);
|
||||||
|
if(a->kt)
|
||||||
|
krb5_kt_close(context, a->kt);
|
||||||
free (a);
|
free (a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,7 +93,7 @@ any_resolve(krb5_context context, const char *name, krb5_keytab id)
|
|||||||
id->data = a0;
|
id->data = a0;
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
free_list (a0);
|
free_list (context, a0);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +114,7 @@ any_close (krb5_context context,
|
|||||||
{
|
{
|
||||||
struct any_data *a = id->data;
|
struct any_data *a = id->data;
|
||||||
|
|
||||||
free_list (a);
|
free_list (context, a);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user