use strdup

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1620 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-04-23 21:28:36 +00:00
parent b2ad71815b
commit f52b23bb20

View File

@@ -91,10 +91,9 @@ get_for_creds(etype, sumtype, rhost, client, enc_key, forwardable, outbuf)
if (!rhost || !(hp = gethostbyname(rhost)))
return KRB5_ERR_BAD_HOSTNAME;
remote_host = (char *) malloc(strlen(hp->h_name)+1);
if (!remote_host)
remote_host = strdup(hp->h_name);
if (remote_host == NULL)
return ENOMEM;
strcpy(remote_host, hp->h_name);
if (retval = krb5_get_host_realm(remote_host, &hrealms)) {
free(remote_host);