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) 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1999 - 2001 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -51,14 +51,17 @@ krb5_copy_host_realm(krb5_context context,
|
||||
++n;
|
||||
++n;
|
||||
*to = malloc (n * sizeof(**to));
|
||||
if (*to == NULL)
|
||||
if (*to == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
for (i = 0; i < n; ++i)
|
||||
(*to)[i] = NULL;
|
||||
for (i = 0, p = from; *p != NULL; ++p, ++i) {
|
||||
(*to)[i] = strdup(*p);
|
||||
if ((*to)[i] == NULL) {
|
||||
krb5_free_host_realm (context, *to);
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user