add some krb5_{set,clear}_error_string
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9937 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -47,8 +47,10 @@ mkt_resolve(krb5_context context, const char *name, krb5_keytab id)
|
||||
{
|
||||
struct mkt_data *d;
|
||||
d = malloc(sizeof(*d));
|
||||
if(d == NULL)
|
||||
if(d == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
d->entries = NULL;
|
||||
d->num_entries = 0;
|
||||
id->data = d;
|
||||
@@ -115,8 +117,10 @@ mkt_add_entry(krb5_context context,
|
||||
struct mkt_data *d = id->data;
|
||||
krb5_keytab_entry *tmp;
|
||||
tmp = realloc(d->entries, (d->num_entries + 1) * sizeof(*d->entries));
|
||||
if(tmp == NULL)
|
||||
if(tmp == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
d->entries = tmp;
|
||||
return krb5_kt_copy_entry_contents(context, entry,
|
||||
&d->entries[d->num_entries++]);
|
||||
|
Reference in New Issue
Block a user