* kcmd.c (kcmd()) : Don't use hp->h_name use host_save instead
authorChris Provenzano <proven@mit.edu>
Thu, 27 Apr 1995 01:12:53 +0000 (01:12 +0000)
committerChris Provenzano <proven@mit.edu>
Thu, 27 Apr 1995 01:12:53 +0000 (01:12 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5530 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/kcmd.c

index d2ba8af43439bd8f42297f2148abe04903e33f2a..3605fdc86103efda9bd9d81fb9399db47a2880ef 100644 (file)
@@ -1,3 +1,7 @@
+Wed Apr 26 21:09:34 1995  Chris Provenzano  (proven@mit.edu)
+
+       * kcmd.c (kcmd()) : Don't use hp->h_name use host_save instead.
+
 Wed Apr 26 17:43:08 1995  Mark Eichin  <eichin@cygnus.com>
 
        * logutil.c (EMPTY): linux has UT_UNKNOWN, not EMPTY.
index b23f2f9b7a043dfb9bcc82544e5dff4ca8a42de6..ad376e53098ffb87ce1a1a3ef6030c5ad7aef3a3 100644 (file)
@@ -109,8 +109,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm,
        return (-1);
     }
     
-    host_save = (char *)malloc(strlen(hp->h_name) + 1);
-    if ( host_save == (char *) 0){
+    if ((host_save = malloc(strlen(hp->h_name) + 1)) == NULL) {
         fprintf(stderr,"kcmd: no memory\n");
         return(-1);
     }
@@ -209,7 +208,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm,
            continue;
        }
 #endif /* !(defined(ultrix) || defined(sun)) */
-       perror(hp->h_name);
+       perror(host_save);
 #ifdef POSIX_SIGNALS
        sigprocmask(SIG_SETMASK, &oldmask, (sigset_t*)0);
 #else
@@ -329,7 +328,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm,
     
     if (options & OPTS_FORWARD_CREDS) {   /* Forward credentials */
        if (status = get_for_creds(bsd_context, auth_context,
-                                       hp->h_name,
+                                       host_save,
                                        ret_cred->client,
                                        /* Forwardable TGT? */
                                        options & OPTS_FORWARDABLE_CREDS,