summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/copy_host_realm.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/copy_host_realm.c')
-rw-r--r--crypto/heimdal/lib/krb5/copy_host_realm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/heimdal/lib/krb5/copy_host_realm.c b/crypto/heimdal/lib/krb5/copy_host_realm.c
index 4a8f3ec..38fdfa8 100644
--- a/crypto/heimdal/lib/krb5/copy_host_realm.c
+++ b/crypto/heimdal/lib/krb5/copy_host_realm.c
@@ -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.
*
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: copy_host_realm.c,v 1.3 1999/12/02 17:05:08 joda Exp $");
+RCSID("$Id: copy_host_realm.c,v 1.4 2001/05/14 06:14:45 assar Exp $");
/*
* Copy the list of realms from `from' to `to'.
@@ -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;
}
}
OpenPOWER on IntegriCloud