return the while list, not just the last entry.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23935 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -370,27 +370,32 @@ krb5_config_file_free (krb5_context context, krb5_config_section *s)
|
|||||||
krb5_error_code
|
krb5_error_code
|
||||||
_krb5_config_copy(krb5_context context,
|
_krb5_config_copy(krb5_context context,
|
||||||
krb5_config_section *c,
|
krb5_config_section *c,
|
||||||
krb5_config_section **d)
|
krb5_config_section **head)
|
||||||
{
|
{
|
||||||
krb5_config_binding **previous = NULL;
|
krb5_config_binding *d, *previous = NULL;
|
||||||
|
|
||||||
|
*head = NULL;
|
||||||
|
|
||||||
while (c) {
|
while (c) {
|
||||||
*d = calloc(1, sizeof(**d));
|
d = calloc(1, sizeof(*d));
|
||||||
|
|
||||||
(*d)->name = strdup(c->name);
|
if (*head == NULL)
|
||||||
(*d)->type = c->type;
|
*head = d;
|
||||||
if ((*d)->type == krb5_config_string)
|
|
||||||
(*d)->u.string = strdup(c->u.string);
|
d->name = strdup(c->name);
|
||||||
else if ((*d)->type == krb5_config_list)
|
d->type = c->type;
|
||||||
_krb5_config_copy (context, c->u.list, &(*d)->u.list);
|
if (d->type == krb5_config_string)
|
||||||
|
d->u.string = strdup(c->u.string);
|
||||||
|
else if (d->type == krb5_config_list)
|
||||||
|
_krb5_config_copy (context, c->u.list, &d->u.list);
|
||||||
else
|
else
|
||||||
krb5_abortx(context,
|
krb5_abortx(context,
|
||||||
"unknown binding type (%d) in krb5_config_copy",
|
"unknown binding type (%d) in krb5_config_copy",
|
||||||
(*d)->type);
|
d->type);
|
||||||
if (previous)
|
if (previous)
|
||||||
*previous = *d;
|
previous->next = d;
|
||||||
|
|
||||||
previous = &(*d)->next;
|
previous = d;
|
||||||
c = c->next;
|
c = c->next;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user