summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/expand_hostname.c
diff options
context:
space:
mode:
authorassar <assar@FreeBSD.org>2001-06-21 02:12:07 +0000
committerassar <assar@FreeBSD.org>2001-06-21 02:12:07 +0000
commit0c8fa354358381b3f1b92598e7f1b46f8cf744cc (patch)
treeed28ffb73cc0ae48a9892dab3f10b09bc36436d5 /crypto/heimdal/lib/krb5/expand_hostname.c
parent06c859ecf534f468a52f24a3eb14409d73a4907c (diff)
downloadFreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.zip
FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.tar.gz
import of heimdal 0.3f
Diffstat (limited to 'crypto/heimdal/lib/krb5/expand_hostname.c')
-rw-r--r--crypto/heimdal/lib/krb5/expand_hostname.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/crypto/heimdal/lib/krb5/expand_hostname.c b/crypto/heimdal/lib/krb5/expand_hostname.c
index 72c5718..848c8ab 100644
--- a/crypto/heimdal/lib/krb5/expand_hostname.c
+++ b/crypto/heimdal/lib/krb5/expand_hostname.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999 - 2000 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: expand_hostname.c,v 1.9 2000/02/23 03:12:07 assar Exp $");
+RCSID("$Id: expand_hostname.c,v 1.10 2001/05/14 06:14:46 assar Exp $");
static krb5_error_code
copy_hostname(krb5_context context,
@@ -41,8 +41,10 @@ copy_hostname(krb5_context context,
char **new_hostname)
{
*new_hostname = strdup (orig_hostname);
- if (*new_hostname == NULL)
+ if (*new_hostname == NULL) {
+ krb5_set_error_string(context, "malloc: out of memory");
return ENOMEM;
+ }
strlwr (*new_hostname);
return 0;
}
@@ -70,10 +72,12 @@ krb5_expand_hostname (krb5_context context,
if (a->ai_canonname != NULL) {
*new_hostname = strdup (a->ai_canonname);
freeaddrinfo (ai);
- if (*new_hostname == NULL)
+ if (*new_hostname == NULL) {
+ krb5_set_error_string(context, "malloc: out of memory");
return ENOMEM;
- else
+ } else {
return 0;
+ }
}
}
freeaddrinfo (ai);
OpenPOWER on IntegriCloud