use a common strdup()
authorJohn Kohl <jtkohl@mit.edu>
Tue, 30 Apr 1991 11:34:29 +0000 (11:34 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Tue, 30 Apr 1991 11:34:29 +0000 (11:34 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2064 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/get_krbhst.c
src/lib/krb5/os/sn2princ.c

index 6660708ca3785ec3c44fe7265ddb252eb9faf873..dc75422b36884548061d12ec4b9d2d6611e51ad7 100644 (file)
@@ -49,17 +49,6 @@ static char rcsid_get_krbhst_c [] =
 extern char *krb5_config_file;         /* extern so can be set at
                                           load/runtime */
 
-static char *
-strsave(string)
-char *string;
-{
-    register char *cp;
-    cp = malloc(strlen(string)+1);
-    if (cp)
-       (void) strcpy(cp, string);
-    return(cp);
-}
-
 krb5_error_code
 krb5_get_krbhst(realm, hostlist)
 krb5_data *realm;
@@ -94,7 +83,7 @@ char ***hostlist;
                retval = KRB5_CONFIG_BADFORMAT;
                break;
            }
-           rethlist[hlindex] = strsave(&filebuf[realm->length+1]);
+           rethlist[hlindex] = strdup(&filebuf[realm->length+1]);
            if (!rethlist[hlindex]) {
                for (--hlindex; hlindex >= 0; hlindex--)
                    free(rethlist[hlindex]);
index 71f4d4f4149a80b1cca16c851b36946993afab4e..4504494736875e88065951e411f05f60151b44e2 100644 (file)
@@ -23,18 +23,6 @@ static char rcsid_sn2princ_c[] =
 #include <netdb.h>
 #include <ctype.h>
 
-#ifndef        HAVE_STRDUP
-static char *
-strdup(s)
-register char *s;
-{
-       register char *ret;
-       if (ret = (char *)malloc(strlen(s)+1))
-               strcpy(ret, s);
-       return(ret);
-}
-#endif
-
 krb5_error_code
 krb5_sname_to_principal(DECLARG(const char *,hostname),
                        DECLARG(const char *,sname),